-
Notifications
You must be signed in to change notification settings - Fork 788
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
Windows duplicates Escape key input. #4038
Labels
bug
Something isn't working
Comments
Hey, thanks for opening this issue and for doing some investigation beforehand. |
In To Do. Suspect @kupuguy is correct about the root cause. |
davep
added a commit
to davep/textual
that referenced
this issue
Jan 31, 2024
davep
added a commit
to davep/textual
that referenced
this issue
Jan 31, 2024
Co-authored-by: Duncan Booth <kupuguy@gmail.com>
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Thanks for that @kupuguy, now in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have you checked closed issues? https://github.com/Textualize/textual/issues?q=is%3Aissue+is%3Aclosed
Please give a brief but clear explanation of the issue. If you can, include a complete working example that demonstrates the bug. Check it can run without modifications.
It will be helpful if you run the following command and paste the results:
Feel free to add screenshots and / or videos. These can be very helpful!
To reproduce run
textual keys
and press some keys. PressingEsc
shows two keys, other keys show only once:I think the problem is with https://github.com/Textualize/textual/blob/0ad03f3731ae922d1faa6852e14ea60e6932b198/src/textual/drivers/win32.py#L267C64-L267C64
This line processes both the key down and the key up events for
esc
which results in it appearing as two keys in the input. Simply changing the line to readif key_event.bKeyDown:
appears to fix the issue asescape
now only appears once in the input and other keys such as function keys continue to work as before.Textual Diagnostics
Versions
Python
| Name | Value
|
|----------------|---------------------------------------------------------------------------------------------------------|
| Version | 3.12.1
|
| Implementation | CPython
|
| Compiler | MSC v.1937 64 bit (AMD64)
|
| Executable | C:\Users\dunca\AppData\Local\pypoetry\Cache\virtualenvs\dwarf-copier-_FteSHy5-py3.12\Scripts\python.exe |
Operating System
Terminal
Rich Console options
The text was updated successfully, but these errors were encountered: