diff --git a/calmwm.h b/calmwm.h index 0a3f830..85141bb 100644 --- a/calmwm.h +++ b/calmwm.h @@ -21,6 +21,7 @@ #ifndef _CALMWM_H_ #define _CALMWM_H_ +#include #include #include #include diff --git a/menu.c b/menu.c index fdeeee4..17c665a 100644 --- a/menu.c +++ b/menu.c @@ -466,7 +466,7 @@ menu_keycode(KeyCode kc, u_int state, enum ctltype *ctl, char *chr) *ctl = CTL_NONE; *chr = '\0'; - ks = XKeycodeToKeysym(X_Dpy, kc, (state & ShiftMask) ? 1 : 0); + ks = XkbKeycodeToKeysym(X_Dpy, kc, 0, (state & ShiftMask) ? 1 : 0); /* Look for control characters. */ switch (ks) { diff --git a/xevents.c b/xevents.c index bc45d70..14c8f2d 100644 --- a/xevents.c +++ b/xevents.c @@ -278,8 +278,8 @@ xev_handle_keypress(XEvent *ee) KeySym keysym, skeysym; int modshift; - keysym = XKeycodeToKeysym(X_Dpy, e->keycode, 0); - skeysym = XKeycodeToKeysym(X_Dpy, e->keycode, 1); + keysym = XkbKeycodeToKeysym(X_Dpy, e->keycode, 0, 0); + skeysym = XkbKeycodeToKeysym(X_Dpy, e->keycode, 0, 1); /* we don't care about caps lock and numlock here */ e->state &= ~(LockMask | Mod2Mask); @@ -327,7 +327,7 @@ xev_handle_keyrelease(XEvent *ee) sc = screen_fromroot(e->root); cc = client_current(); - keysym = XKeycodeToKeysym(X_Dpy, e->keycode, 0); + keysym = XkbKeycodeToKeysym(X_Dpy, e->keycode, 0, 0); if (keysym != XK_Alt_L && keysym != XK_Alt_R) return; diff --git a/xutil.c b/xutil.c index 67cc856..ae07d4e 100644 --- a/xutil.c +++ b/xutil.c @@ -94,8 +94,8 @@ xu_key_grab(Window win, int mask, int keysym) int i; code = XKeysymToKeycode(X_Dpy, keysym); - if ((XKeycodeToKeysym(X_Dpy, code, 0) != keysym) && - (XKeycodeToKeysym(X_Dpy, code, 1) == keysym)) + if ((XkbKeycodeToKeysym(X_Dpy, code, 0, 0) != keysym) && + (XkbKeycodeToKeysym(X_Dpy, code, 0, 1) == keysym)) mask |= ShiftMask; for (i = 0; i < nitems(ign_mods); i++) @@ -110,8 +110,8 @@ xu_key_ungrab(Window win, int mask, int keysym) int i; code = XKeysymToKeycode(X_Dpy, keysym); - if ((XKeycodeToKeysym(X_Dpy, code, 0) != keysym) && - (XKeycodeToKeysym(X_Dpy, code, 1) == keysym)) + if ((XkbKeycodeToKeysym(X_Dpy, code, 0, 0) != keysym) && + (XkbKeycodeToKeysym(X_Dpy, code, 0, 1) == keysym)) mask |= ShiftMask; for (i = 0; i < nitems(ign_mods); i++)