summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2019-08-28 13:27:13 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2019-08-28 13:27:13 +0300
commitbd63d3e1ec50eda33f6c300b90a69e791b9d969c (patch)
tree513bd9556e456d83d3255603c29413f4e5457a24 /platform
parent007a46ef6b9dc26f3f450de91c4ca210271a1070 (diff)
Fix modifier keys causing key-code mismatch on Linux/X11.
Diffstat (limited to 'platform')
-rw-r--r--platform/x11/os_x11.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index ca72393e43..dfa0a45538 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -1757,7 +1757,10 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) {
// XLookupString returns keysyms usable as nice scancodes/
char str[256 + 1];
- XLookupString(xkeyevent, str, 256, &keysym_keycode, NULL);
+ XKeyEvent xkeyevent_no_mod = *xkeyevent;
+ xkeyevent_no_mod.state &= ~ShiftMask;
+ xkeyevent_no_mod.state &= ~ControlMask;
+ XLookupString(&xkeyevent_no_mod, str, 256, &keysym_keycode, NULL);
// Meanwhile, XLookupString returns keysyms useful for unicode.