-
Notifications
You must be signed in to change notification settings - Fork 47
arrow keys not being sent to readkey() #20
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
Comments
@suresttexas00 Have you tried if the arrows work with the code in PR #13 ? I remember I fixed that for at least Windows, but I might have fixed it for linux as well... I can't remember. |
I'm working on testing that now. So far, all I know is that nothing is broken :P |
UP, RIGHT, DOWN, LEFT produces:
It is entirely random (Somewhere between the 1st and 3rd keypress) when a ^[[* character is printed. I am sure there might be a pattern that a gifted autistic might note; but I suck and it seems random to me :) |
The way special characters can be printed under Linux at the moment is different than on Windows. Try the following before anything else. Maybe it actually works:
If not, you probably need to look at the raw values returned by the following function in order to fix the arrows on linux You might need more than one call to this function to get all the data from a single key press. Maybe there is a missing escape sequence in key.py that prevents getting the arrows. |
I rewrote readchar_linux.py using the same logic and it now appears to detect the arrow keys now:
I'm sure that could be a little cleaner.. like I am not sure the |
The next step would be to take these linux constants and map them to the same readable string values you are using in the windows version, so that they will compare equally on either system. have in keys.py:
and then have the charbuffer scrubbed to replace:
|
Release 0.8 |
Release 1.0 tried to manage ESC key, but it is very confusing and obfuscate the code a lot. So I backtrack to 0.7 with some minor changes, where arrow keys were working fine. Thank you anyways for your effort. |
got a new pull request based on my comment about # 1 fix above (so # 2 is still an issue - cant' get Esc key by itself or F11/F12. |
I could probably fix that too, but it might break the windows part... and I own no windoze machines to test! :) |
I have this little routine and all I am getting is one character, 0x1b, when an arrow key is pressed:
Everything works famously (THANKS :) ), except this part:
I'm sure it is because it is not reading arrow sequences...
The text was updated successfully, but these errors were encountered: