diff --git a/legacy/ecore/src/lib/ecore_x/ecore_x.c b/legacy/ecore/src/lib/ecore_x/ecore_x.c index 672d59b299..369da7a4cf 100644 --- a/legacy/ecore/src/lib/ecore_x/ecore_x.c +++ b/legacy/ecore/src/lib/ecore_x/ecore_x.c @@ -1415,16 +1415,22 @@ void ecore_x_window_key_grab(Ecore_X_Window win, char *key, int mod, int any_mod) { - KeyCode keycode; + KeyCode keycode = 0; KeySym keysym; unsigned int m; unsigned int locks[8]; int i; - keysym = XStringToKeysym(key); - if (keysym == NoSymbol) return; - keycode = XKeysymToKeycode(_ecore_x_disp, XStringToKeysym(key)); + if (!strncmp(key, "Keycode-", 8)) + keycode = atoi(key + 8); + else + { + keysym = XStringToKeysym(key); + if (keysym == NoSymbol) return; + keycode = XKeysymToKeycode(_ecore_x_disp, XStringToKeysym(key)); + } if (keycode == 0) return; + m = mod; if (any_mod) m = AnyModifier; locks[0] = 0; @@ -1448,16 +1454,22 @@ void ecore_x_window_key_ungrab(Ecore_X_Window win, char *key, int mod, int any_mod) { - KeyCode keycode; + KeyCode keycode = 0; KeySym keysym; unsigned int m; unsigned int locks[8]; int i, shuffle = 0; - keysym = XStringToKeysym(key); - if (keysym == NoSymbol) return; - keycode = XKeysymToKeycode(_ecore_x_disp, XStringToKeysym(key)); + if (!strncmp(key, "Keycode-", 8)) + keycode = atoi(key + 8); + else + { + keysym = XStringToKeysym(key); + if (keysym == NoSymbol) return; + keycode = XKeysymToKeycode(_ecore_x_disp, XStringToKeysym(key)); + } if (keycode == 0) return; + m = mod; if (any_mod) m = AnyModifier; locks[0] = 0;