-
-
Notifications
You must be signed in to change notification settings - Fork 653
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
Escape key used as toga.Command shortcut does not trigger callback #2526
Comments
Thanks for the report - thanks to your sample code, I've been able to reproduce this. After a little investigation, it appears that this is a macOS limitation/feature. If you search this document for "Escape", there's a mention that:
There's a couple of other mentions of how to work around this, but they're fairly low level modifications to the keyboard handling process. On that basis, my immediate suggestion is that a bare Escape would be best to avoid as a keyboard shortcut, because of the overlap with existing OS keyboard handlers. At the very least this general problem is worth noting in the documentation - ideally we'd provide a list of keys that aren't good candidates for keyboard shortcuts. That could arguably be surfaced as a platform-level warning/error as well. |
Describe the bug
The
Escape
key does not work on macOS when specified as ashortcut
to atoga.Command
. The keystroke is merely ignored.Steps to reproduce
Put the following code in a python file:
Run the python file.
Pressing "X" on the keyboard when the app is open will quit the app, and hitting escape will not.
Expected behavior
The associated callback is run.
Screenshots
Environment
Logs
Additional context
No response
The text was updated successfully, but these errors were encountered: