-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Linux/BSD: Modify only keypad keys #102169
Conversation
I can confirm this fixes the number pad issue mention on #101848. |
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.
Tested locally, it works as expected. The issue with script editor hover tooltips no longer appearing until you alt-tab out and back in is also fixed with this PR.
Disabling numlock in the script editor works as intended for navigational purposes, but this was also the case in master
before this PR.
Code looks good to me.
Operating System: Fedora Linux 41
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Kernel Version: 6.12.9-200.fc41.x86_64 (64-bit)
Graphics Platform: X11
Before
Numlock OFF | Numlock ON |
---|---|
![]() |
![]() |
After
Notice that Unicode is now "Kp 0" instead of "0" for Numlock ON.
Numlock OFF | Numlock ON |
---|---|
![]() |
![]() |
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.
Seems to fix Numpad issue, but breaks some layouts on X11.
510f03f
to
140a63b
Compare
The `keycode` field of `InputEventKey` is supposed to be "unshifted"; That is, what the key would output if no modifier keys were pressed. This should match what's written on the key label, but `Key` enumerates also all keypad keys, which require a modifier. We thus require some extra checks for them. Note that this can still allow "stuck keys", but that's an even deeper problem.
Thanks! |
Should greatly alleviate #102137.
Fixes #102259.
The
keycode
field ofInputEventKey
is supposed to be "unshifted"; That is, what the key would output if no modifier keys were pressed. This should match what's written on the key label, butKey
enumerates also all keypad keys, which require a modifier. We thus require some extra checks for them.Note that this can still allow "stuck keys", but that's an even deeper problem.
This should bring both the X11 and Wayland backend to "parity" with Windows. Now only keypad keys should be able to get stuck; Better than having every other "non-US" modifier at least.
Feedback appreciated on the X11 impl.
Also note that I purposely made the "is keypad" method specific to only the related (modified)
Key
enumerations. If that's excessive, we could replace it with a simple check betweenXKB_KEY_KP_Space
andXKB_KEY_KP_9
(same for the XK equivalent on X11), as all keypad scancodes are consecutive. That would require no other changes as I built the code to allow for "no matches" to the mapping table, just in case.CC @bruvzg