mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
XKeycodeToKeysym --> XGetKeyboardMapping (XKeycodeToKeysym is allegedly deprecated)
This commit is contained in:
parent
7275ca47ff
commit
8aa21b0311
12
dwm.c
12
dwm.c
@ -2054,16 +2054,18 @@ keypress(XEvent *e)
|
||||
#endif // KEYMODES_PATCH
|
||||
{
|
||||
unsigned int i;
|
||||
KeySym keysym;
|
||||
int keysyms_return;
|
||||
KeySym* keysym;
|
||||
XKeyEvent *ev;
|
||||
|
||||
ev = &e->xkey;
|
||||
keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
|
||||
keysym = XGetKeyboardMapping(dpy, (KeyCode)ev->keycode, 1, &keysyms_return);
|
||||
for (i = 0; i < LENGTH(keys); i++)
|
||||
if (keysym == keys[i].keysym
|
||||
&& CLEANMASK(keys[i].mod) == CLEANMASK(ev->state)
|
||||
&& keys[i].func)
|
||||
if (*keysym == keys[i].keysym
|
||||
&& CLEANMASK(keys[i].mod) == CLEANMASK(ev->state)
|
||||
&& keys[i].func)
|
||||
keys[i].func(&(keys[i].arg));
|
||||
XFree(keysym);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user