Fix T49303: Fix T49314: More issues with new handling of X11 shortcuts.

This commits changes two things:
* It adds more keysyms preferably taken from XLookupKeysym than XLookupString (namely, all numpad ones).
* It falls back to keysyms from XLookupKeysym in other cases, when XLookupString does not produce anything we know of.

Finding the correct balance here is far from easy, but think we are comming rather close to it now...
This commit is contained in:
Bastien Montagne 2016-09-10 12:38:12 +02:00
parent 2820ab5a8f
commit 037df2aaa6
Notes: blender-bot 2023-02-14 07:37:22 +01:00
Referenced by issue #49314, event.type=NONE if shift is pressed ( for MINUS and SEMI_COLON )
Referenced by issue #49303, Numpad decimal with non-US english keyboard layout
1 changed files with 22 additions and 2 deletions

View File

@ -902,7 +902,8 @@ GHOST_SystemX11::processEvent(XEvent *xe)
ascii = '\0';
}
/* Only allow a very limited set of keys from XLookupKeysym, all others we take from XLookupString... */
/* Only allow a limited set of keys from XLookupKeysym, all others we take from XLookupString,
* unless it gives unknown key... */
gkey = convertXKey(key_sym);
switch (gkey) {
case GHOST_kKeyRightAlt:
@ -922,9 +923,28 @@ GHOST_SystemX11::processEvent(XEvent *xe)
case GHOST_kKey7:
case GHOST_kKey8:
case GHOST_kKey9:
case GHOST_kKeyNumpad0:
case GHOST_kKeyNumpad1:
case GHOST_kKeyNumpad2:
case GHOST_kKeyNumpad3:
case GHOST_kKeyNumpad4:
case GHOST_kKeyNumpad5:
case GHOST_kKeyNumpad6:
case GHOST_kKeyNumpad7:
case GHOST_kKeyNumpad8:
case GHOST_kKeyNumpad9:
case GHOST_kKeyNumpadPeriod:
case GHOST_kKeyNumpadEnter:
case GHOST_kKeyNumpadPlus:
case GHOST_kKeyNumpadMinus:
case GHOST_kKeyNumpadAsterisk:
case GHOST_kKeyNumpadSlash:
break;
default:
gkey = convertXKey(key_sym_str);
GHOST_TKey gkey_str = convertXKey(key_sym_str);
if (gkey_str != GHOST_kKeyUnknown) {
gkey = gkey_str;
}
}
#else
/* In keyboards like latin ones,