-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
More support for linux / other unixish systems #100
Conversation
Doesn't yet handle keys (including arrows and function keys) that come as escape sequences in raw mode. Shift is the only supported modifier.
Don't worry about Windows support. Just Linux/MacOS should be good enough for this PR. You can remove what Windows support currently exists to get this working if you need to. Later Windows support can be added either through this renderer or by using the older Windows Console API instead of escape codes. |
Keep in mind that the SCons MinGW builds were failing before your PR. I didn't figure out a good way to handle those yet. |
Co-authored-by: Kyle Benesch <4b796c65+github@gmail.com>
Co-authored-by: Kyle Benesch <4b796c65+github@gmail.com>
Co-authored-by: Kyle Benesch <4b796c65+github@gmail.com>
Co-authored-by: Kyle Benesch <4b796c65+github@gmail.com>
Ok, sounds good. |
Co-authored-by: Kyle Benesch <4b796c65+github@gmail.com>
Co-authored-by: Kyle Benesch <4b796c65+github@gmail.com>
Co-authored-by: Kyle Benesch <4b796c65+github@gmail.com>
For the keypad, I was assuming I should set the application keypad mode (DECKPAM), and it definitely gets set because xterm itself can show that flag at runtime. But keypad keys with either the layer on my keyboard or xdotool (both of which work for SDL) just get through as single characters characters, with no escapes at all. Was there anything you had seen that I'm missing there? |
You're more ahead of this than I am right now. I don't know what to try next. Application Keypad sounds right and I wouldn't know why it doesn't give escapes. |
Uses what xterm calls "any-event tracking" to get motion events as well as up/down and wheel events. Doesn't use extended coordinates.
Ok, I'll look into it a little more but might have to leave that one. Mouse support is in, and works on xterm, urxvt, gnome-terminal, and kitty. I didn't do extended coordinates. I also added focus in/out events, and handling of requested pixel window size and window position (which like the requested colums and rows is not supported on all terminal enumators and is also up to the window manager). |
Also the alternate CSI codes for home and end.
I think the problem with the keypad is just that there aren't escape codes for the keypad digits, and that's what my keyboard is sending. As arrows, page up, page down, home, and end they will probably work fine but I don't think there is a way to distingish the keypad versions of those keys from non-keypad versions. |
I'm hesitant to ask you for anything else since you've already done an excellent job. I'm not sure how to feel about For input handling I'd like unknown inputs to be logged at the debug level instead of being silently ignored so that they're easier to track. The |
I went through the same thing with double click time and found it in the SDL code but couldn't see any way to access it externally. The current value is the fallback SDL uses in And sure, I can add the logging. I also noticed a couple of annoyances related to key handling: firstly |
Don't worry about it then.
SDL considers |
Just support the most common keyboard layout for now. |
These are not mentioned in the xterm docs but are needed to get those keys in urxvt, and don't conflict with anything else.
Do you think that getting the shift modifer for those keys critical? If not I'd prefer to leave out anything that makes assumptions about the layout, especially since it will just be a big lookup table in the code. For mouse support, I notice the samples program always shows "OUT OF FOCUS" and tile position of 0, 0, but it does with the SDL2 renderer as well. (The xterm renderer also doesn't get the mouse buttons there but that's because the sample uses a direct SDL call.) Should I set a |
Instead of INT_MAX. This makes the terminal size request work in iterm2.
Otherwise the console size can be wrong at first.
To be the most compatible with SDL the keys will need to be changed to their non-shift key codes with the shift key modifier set, but right now I just want something that works at all. Large lookup tables are tedious to write and can be done later.
The samples are out-of-date. The C sample is switched over to contexts but isn't using the correct functions in the mouse sample. The C++ sample is more correct but relies on the SDL window.
No, it already does nothing if left unset. |
Ok, I think I'm done then. I did some more testing:
(I didn't bother testing setting window pixel size and position here.) SSH seems to work fine. So I'll mark this PR as ready. Let me know if you want me to rebase to clean anything up. |
So far this is features copied over from my python project.