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
Don't trigger a key event if a key with the same associated char was pressed #13773
Conversation
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.
Confirmed the bug on Linux with non-SDL Irrlicht. The fix works and makes sense.
The fix also results in being unable to change your viewing range using the numpad + and - keys with the default keymap, but I don't think that's a problem (this is expected, the non-numpad versions of the keys still work).
I can't reproduce the bug on Linux with SDL Irrlicht. If you press a numpad key there, Char
always seems to be set to 0.
Consider adding a short unit test for |
Done |
@@ -111,7 +111,7 @@ void TestKeycode::testCompare() | |||
{ | |||
// Basic comparison | |||
UASSERT(KeyPress("5") == KeyPress("KEY_KEY_5")); | |||
UASSERT(!(KeyPress("5") == KeyPress("KEY_NUMPAD_5"))); | |||
UASSERT(!(KeyPress("5") == KeyPress("KEY_NUMPAD5"))); |
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.
This was broken for a while
…har was pressed (minetest#13773)" This reverts commit d57c936. The reverted commit prevented recognition of key combinations. Several keyboard layouts use a key combination to input a “+” (e.g. Neo2); therefore some users could no longer input “+” to increase the view range.
…har was pressed (minetest#13773)" This partially reverts commit d57c936. The reverted commit prevented recognition of key combinations. It correctly changed a test case to no longer use “KEY_NUMPAD_5”. Several keyboard layouts use a key combination to input a “+” (e.g. Neo2); therefore some users could no longer input “+” to increase the view range. Co-authored-by: savilli <78875209+savilli@users.noreply.github.com>
…har was pressed (#13773)" This partially reverts commit d57c936. The reverted commit prevented recognition of key combinations. It correctly changed a test case to no longer use “KEY_NUMPAD_5”. Several keyboard layouts use a key combination to input a “+” (e.g. Neo2); therefore some users could no longer input “+” to increase the view range. Co-authored-by: savilli <78875209+savilli@users.noreply.github.com>
…har was pressed (minetest#13773)" This partially reverts commit d57c936. The reverted commit prevented recognition of key combinations. It correctly changed a test case to no longer use “KEY_NUMPAD_5”. Several keyboard layouts use a key combination to input a “+” (e.g. Neo2); therefore some users could no longer input “+” to increase the view range. Co-authored-by: savilli <78875209+savilli@users.noreply.github.com>
…har was pressed (minetest#13773)" This partially reverts commit d57c936. The reverted commit prevented recognition of key combinations. It correctly changed a test case to no longer use “KEY_NUMPAD_5”. Several keyboard layouts use a key combination to input a “+” (e.g. Neo2); therefore some users could no longer input “+” to increase the view range. Co-authored-by: savilli <78875209+savilli@users.noreply.github.com>
Fix #13770
See #13770 (comment)
To do
This PR is Ready for Review.
How to test
Check that pressing a numpad key doesn't change the active item