JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Ignore numlock (Mod2Mask) for button events too.
authorMark Edgar <medgar123@gmail.com>
Sat, 21 Sep 2013 22:07:49 +0000 (00:07 +0200)
committerRoberto E. Vargas Caballero <k0ga@shike2.com>
Sun, 20 Oct 2013 07:53:34 +0000 (09:53 +0200)
Conflicts:
config.def.h
st.c

config.def.h
st.c

index def6c9e..2a7e098 100644 (file)
@@ -146,10 +146,10 @@ static Shortcut shortcuts[] = {
 static KeySym mappedkeys[] = { -1 };
 
 /*
- * Which bits of the state should be ignored. By default the state bit for the
- * keyboard layout (XK_SWITCH_MOD) is ignored.
+ * State bits to ignore when matching key or button events.  By default,
+ * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
  */
-uint ignoremod = XK_SWITCH_MOD;
+static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
 
 /* key, mask, output, keypad, cursor, crlf */
 static Key key[] = {
diff --git a/st.c b/st.c
index 50b58a7..12e1e1f 100644 (file)
--- a/st.c
+++ b/st.c
@@ -3579,7 +3579,6 @@ kpress(XEvent *ev) {
                return;
 
        len = XmbLookupString(xw.xic, e, buf, sizeof buf, &ksym, &status);
-       e->state &= ~Mod2Mask;
        /* 1. shortcuts */
        for(bp = shortcuts; bp < shortcuts + LEN(shortcuts); bp++) {
                if(ksym == bp->keysym && match(bp->mod, e->state)) {