handle binding raw keycodes too

SVN revision: 14564
This commit is contained in:
Carsten Haitzler 2005-05-03 04:28:15 +00:00
parent 4efff6222e
commit 32b7ff4314
1 changed files with 20 additions and 8 deletions

View File

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