aboutsummaryrefslogtreecommitdiffstats
path: root/xevents.c
diff options
context:
space:
mode:
authoroga2008-06-17 23:40:33 +0000
committeroga2008-06-17 23:40:33 +0000
commite81c12ba73d4e86fe08110f8fa1fabc02745626c (patch)
tree8bf597fd72b6543daa7684421bf7f177599387e5 /xevents.c
parentd8992dea78215e8b6fd889297b028280fd28922d (diff)
downloadcwm-e81c12ba73d4e86fe08110f8fa1fabc02745626c.tar.gz
Ignore caps lock and numlock for keyboard bindings. The way Xlib makes
you do this is ugly. Also remove mod2 (numlock) and mod3 (odd) from the list of keybinding modifiers. They don't make much sense here. based on a heavily modified diff from Martynas. ok okan.
Diffstat (limited to '')
-rw-r--r--xevents.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/xevents.c b/xevents.c
index 299993d..5c60f82 100644
--- a/xevents.c
+++ b/xevents.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: xevents.c,v 1.22 2008/06/17 20:55:48 oga Exp $
+ * $Id: xevents.c,v 1.23 2008/06/17 23:40:33 oga Exp $
*/
/*
@@ -228,6 +228,9 @@ xev_handle_buttonpress(struct xevent *xev, XEvent *ee)
cc = client_find(e->window);
+ /* Ignore caps lock and numlock */
+ e->state &= ~(Mod2Mask | LockMask);
+
TAILQ_FOREACH(mb, &Conf.mousebindingq, entry) {
if (e->button == mb->button && e->state == mb->modmask)
break;
@@ -273,6 +276,9 @@ xev_handle_keypress(struct xevent *xev, XEvent *ee)
keysym = XKeycodeToKeysym(X_Dpy, e->keycode, 0);
skeysym = XKeycodeToKeysym(X_Dpy, e->keycode, 1);
+ /* we don't care about caps lock and numlock here */
+ e->state &= ~(LockMask | Mod2Mask);
+
TAILQ_FOREACH(kb, &Conf.keybindingq, entry) {
if (keysym != kb->keysym && skeysym == kb->keysym)
modshift = ShiftMask;