-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix: Keybindings on Numpad special keys (#7315) #7329
Fix: Keybindings on Numpad special keys (#7315) #7329
Conversation
@spoenemann @akosyakov Can you have a look? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot test it with my keyboard, but the change makes sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we really use keyCode
though? MDN shows it as deprecated.
I tested with https://w3c.github.io/uievents/tools/key-event-viewer.html:
event.key
seems to map to the same key representation, when event.code
maps to the layout-independent identifier (see 1-and-2 vs 1-and-4)
@marechal-p Oh, that's news to me, thx. Switched to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well, thanks!
@spoenemann are you fine with changes, please merge if so |
Note that |
@spoenemann |
Does it work also when Numlock is enabled? In that case IMO it would be safer to switch back to |
@spoenemann and I found out that We narrowed the corner case to "complex numpad keys" by adding the check for |
This adds an exception to `KeyCode.toKey` regarding special keys on numpads Signed-off-by: Gero Posmyk-Leinemann <[email protected]>
Fixes #7315.
This adds an exception to
KeyCode.toKey
regarding special keys on numpadsSigned-off-by: Gero Posmyk-Leinemann [email protected]
What it does
This adds an exception for Numpad keys during the
KeyboardEvent
-> key bindings resolution. It ensures that with Numlock disabled, special keys likeHOME
(on Numpad7),END
(on Numpad1) etc. are detected and handled correctly.How to test
Numpad7
(HOME
),Numpad1
(END
),Numpad9
(Page Up
),Numpad3 (
Page Down`) and observe the respective cursor movementReview checklist
Reminder for reviewers