From 637edf38d51024ba88184b1457640f8fa459e693 Mon Sep 17 00:00:00 2001 From: okan Date: Mon, 10 Sep 2012 13:28:04 +0000 Subject: [PATCH] be explicit in which key masks we allow during keypress and buttonpress events; from Alexander Polakov - makes non-us layout reliable. --- xevents.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xevents.c b/xevents.c index eddf4fe..a155614 100644 --- a/xevents.c +++ b/xevents.c @@ -240,8 +240,8 @@ xev_handle_buttonpress(XEvent *ee) sc = screen_fromroot(e->root); cc = client_find(e->window); - /* Ignore caps lock and numlock */ - e->state &= ~(Mod2Mask | LockMask); + /* only allow the ones we care about */ + e->state &= (ControlMask | Mod1Mask | Mod4Mask | ShiftMask); TAILQ_FOREACH(mb, &Conf.mousebindingq, entry) { if (e->button == mb->button && e->state == mb->modmask) @@ -282,8 +282,8 @@ xev_handle_keypress(XEvent *ee) 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); + /* only allow the ones we care about */ + e->state &= (ControlMask | Mod1Mask | Mod4Mask | ShiftMask); TAILQ_FOREACH(kb, &Conf.keybindingq, entry) { if (keysym != kb->keysym && skeysym == kb->keysym)