-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Handle events on NumPad when NumLock is disabled #1188
Conversation
Hi, Why the condition including not shift? Thank you. |
app/src/event_converter.c
Outdated
|
||
if (!(mod & (KMOD_NUM | KMOD_SHIFT))) { | ||
// handling Numpad events when Num Lock is disabled | ||
switch(from){ |
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 believe that there are some coding style issues.
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 did some modifications regarding the coding style issues. Can you tell me what was exactly the issue?
Thank you
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.
Great! From now, I only notice that we need a space after switch.
Hi, I tried to mimic the behavior of the keyboard. If you disable the NumLock, and try the NumPad numbers with SHIFT, it'll work as the NumLock was enabled. EDIT: At least, on Ubuntu system |
I try it on my windows 10 ver 1909, the shift + numpad when num lock off, it works like shift + arrow, insert, home, etc. |
Should we go for Windows behavior? or the Ubuntu's one? Thanks |
The behavior problem should contact @rom1v . Thank you. |
PR #1188 <#1188> Fixes #1048 <#1048> Signed-off-by: Romain Vimont <[email protected]>
PR #1188 <#1188> Fixes #1048 <#1048> Signed-off-by: Romain Vimont <[email protected]>
PR #1188 <#1188> Fixes #1048 <#1048> Signed-off-by: Romain Vimont <[email protected]>
PR #1188 <#1188> Fixes #1048 <#1048> Signed-off-by: Romain Vimont <[email protected]>
Thank you for your contribution (and sorry for the delay). I think checking SHIFT like you do produces the correct behavior: if shift is enabled, a text event will be generated, and managed as a text, so we must absolutely not send key events in that case. IMO, the block should be moved few lines above so that it works even if I squashed your commits, rebased on Please review and if it's ok I'll merge into |
Thank you for your answer. Since it is one of my first contributions, yes everything is fine for me. |
Congrats 🎉 Merged in |
Hello, I tried to fix the issue #1048.
I mapped the NumPad keys as follow when both SHIFT and NUM aren't set: