[Bf-blender-cvs] [037df2a] master: Fix T49303: Fix T49314: More issues with new handling of X11 shortcuts.

Bastien Montagne noreply at git.blender.org
Sat Sep 10 12:41:22 CEST 2016


Commit: 037df2aaa6b36aa4f4e78f3ef978a8196be0057d
Author: Bastien Montagne
Date:   Sat Sep 10 12:38:12 2016 +0200
Branches: master
https://developer.blender.org/rB037df2aaa6b36aa4f4e78f3ef978a8196be0057d

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

===================================================================

M	intern/ghost/intern/GHOST_SystemX11.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index 9a2dcfc..30cfac0 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -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,




More information about the Bf-blender-cvs mailing list