Merge pull request #31740 from bruvzg/x11_mod_keys

Fix modifier keys causing key-code mismatch on Linux/X11.
This commit is contained in:
Rémi Verschelde 2019-08-29 08:34:25 +02:00 committed by GitHub
commit c475f89ff7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.