JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Adding a way to ignore bits in the state.
[st.git] / st.c
diff --git a/st.c b/st.c
index f6e606b..64366af 100644 (file)
--- a/st.c
+++ b/st.c
@@ -61,6 +61,7 @@
 #define DRAW_BUF_SIZ  20*1024
 #define XK_ANY_MOD    UINT_MAX
 #define XK_NO_MOD     0
+#define XK_SWITCH_MOD (1<<13)
 
 #define REDRAW_TIMEOUT (80*1000) /* 80 ms */
 
@@ -3008,6 +3009,8 @@ focus(XEvent *ev) {
 
 inline bool
 match(uint mask, uint state) {
+       state &= ~(ignoremod);
+
        if(mask == XK_NO_MOD && state)
                return false;
        if(mask != XK_ANY_MOD && mask != XK_NO_MOD && !state)
@@ -3182,7 +3185,6 @@ run(void) {
                }
 
                gettimeofday(&now, NULL);
-               /* usecs until (next) frame */
                drawtimeout.tv_sec = 0;
                drawtimeout.tv_usec = (1000/xfps) * 1000;
                tv = &drawtimeout;
@@ -3193,7 +3195,8 @@ run(void) {
                if(FD_ISSET(xfd, &rfd))
                        xev = actionfps;
 
-               if(TIMEDIFF(now, last) > (xev ? (1000/xfps) : (1000/actionfps))) {
+               if(TIMEDIFF(now, last) > \
+                               (xev ? (1000/xfps) : (1000/actionfps))) {
                        while(XPending(xw.dpy)) {
                                XNextEvent(xw.dpy, &ev);
                                if(XFilterEvent(&ev, None))