Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unhandled xterm middle arrow sequence #239

Open
anaseto opened this issue Sep 22, 2018 · 6 comments
Open

unhandled xterm middle arrow sequence #239

anaseto opened this issue Sep 22, 2018 · 6 comments

Comments

@anaseto
Copy link
Contributor

anaseto commented Sep 22, 2018

Hi,

In xterm, the keypad middle arrow can produce a \e[OE sequence, but it is not parsed by tcell. It seems that there are 4 possible sequences for this key.

@gdamore
Copy link
Owner

gdamore commented Sep 24, 2018

I'm really not sure what to do with this. I'm not even sure how this key should be reported. The lack of consistency is just one issue.

The reality is that many modern keyboards don't even have a separate way to report this. (This is why some keyboards separate cursor keys from the numeric keyboard.)

I'm not trying to be facetious when I say I have no idea what we should even call this keypress. It's not a cursor movement, so what is it?

What terminal emulators actually report meaningful data here?

@anaseto
Copy link
Contributor Author

anaseto commented Sep 24, 2018

With a sequence similar to the arrow key ones, adding t.prepareKey(KeyClear, "\x1bOE") in tscreen.go catches the middle arrow in xterm (another possible sequence is "\x1b[E").

That said, I too cannot find any clear sources on which key should be reported: above I put KeyClear just for testing because that is what I've seen done in a game for the windows console as well as for the SDL interface, but it may hide a hack. The curses library seems to report it consistently as KEY_B2, but it seems that this is a keypad specific code.

@gdamore
Copy link
Owner

gdamore commented Aug 30, 2020

This is kb2 in terminfo. There is also ka1, ka3, kc1, and kc3.

@gdamore
Copy link
Owner

gdamore commented Apr 26, 2022

I'm a little concerned that KeyClear may not accurately describe how users think of this key in all circumstances. Admittedly I don't have a keyboard that has this key.

@anaseto
Copy link
Contributor Author

anaseto commented Apr 27, 2022 via email

@gdamore
Copy link
Owner

gdamore commented Oct 14, 2022

I'll probably add a specific constant for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants