summaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
Diffstat (limited to 'st.c')
-rw-r--r--st.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/st.c b/st.c
index 932253c..b8b2bbf 100644
--- a/st.c
+++ b/st.c
@@ -59,8 +59,8 @@
#define STR_ARG_SIZ 16
#define DRAW_BUF_SIZ 20*1024
#define UTF_SIZ 4
-#define XK_NO_MOD UINT_MAX
-#define XK_ANY_MOD 0
+#define XK_ANY_MOD UINT_MAX
+#define XK_NO_MOD 0
#define REDRAW_TIMEOUT (80*1000) /* 80 ms */
@@ -2700,10 +2700,12 @@ kmap(KeySym k, uint state) {
if(kp->k != k)
continue;
- if((state & mask) != mask &&
- (mask == XK_NO_MOD && state)) {
+ if(mask == XK_NO_MOD && state)
+ continue;
+ if(mask != XK_ANY_MOD && mask != XK_NO_MOD && !state)
+ continue;
+ if((state & mask) != state)
continue;
- }
if((kp->appkey < 0 && IS_SET(MODE_APPKEYPAD)) ||
(kp->appkey > 0 && !IS_SET(MODE_APPKEYPAD))) {