diff options
author | Christoph Lohmann <20h@r-36.net> | 2013-02-16 13:57:12 +0100 |
---|---|---|
committer | Christoph Lohmann <20h@r-36.net> | 2013-02-16 13:57:12 +0100 |
commit | f4a6c20f464df79a9b15b4a2a11daaa7a06c60a0 (patch) | |
tree | 7c87c4fe3878af377f9e7fd0dd0ee51b6bb3786e | |
parent | e0ec2cf984ff8006b99cf4ca8590ceec7113daac (diff) | |
download | st-patched-f4a6c20f464df79a9b15b4a2a11daaa7a06c60a0.tar.bz2 st-patched-f4a6c20f464df79a9b15b4a2a11daaa7a06c60a0.tar.xz st-patched-f4a6c20f464df79a9b15b4a2a11daaa7a06c60a0.zip |
Adding a way to ignore bits in the state.
-rw-r--r-- | config.def.h | 6 | ||||
-rw-r--r-- | st.c | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/config.def.h b/config.def.h index 93fc26d..07a22ed 100644 --- a/config.def.h +++ b/config.def.h | |||
@@ -104,6 +104,12 @@ static Shortcut shortcuts[] = { | |||
104 | */ | 104 | */ |
105 | static KeySym mappedkeys[] = { -1 }; | 105 | static KeySym mappedkeys[] = { -1 }; |
106 | 106 | ||
107 | /* | ||
108 | * Which bits of the state should be ignored. By default the state bit for the | ||
109 | * keyboard layout (XK_SWITCH_MOD) is ignored. | ||
110 | */ | ||
111 | uint ignoremod = XK_SWITCH_MOD; | ||
112 | |||
107 | /* key, mask, output, keypad, cursor, crlf */ | 113 | /* key, mask, output, keypad, cursor, crlf */ |
108 | static Key key[] = { | 114 | static Key key[] = { |
109 | /* keysym mask string keypad cursor crlf */ | 115 | /* keysym mask string keypad cursor crlf */ |
@@ -61,6 +61,7 @@ | |||
61 | #define DRAW_BUF_SIZ 20*1024 | 61 | #define DRAW_BUF_SIZ 20*1024 |
62 | #define XK_ANY_MOD UINT_MAX | 62 | #define XK_ANY_MOD UINT_MAX |
63 | #define XK_NO_MOD 0 | 63 | #define XK_NO_MOD 0 |
64 | #define XK_SWITCH_MOD (1<<13) | ||
64 | 65 | ||
65 | #define REDRAW_TIMEOUT (80*1000) /* 80 ms */ | 66 | #define REDRAW_TIMEOUT (80*1000) /* 80 ms */ |
66 | 67 | ||
@@ -3008,6 +3009,8 @@ focus(XEvent *ev) { | |||
3008 | 3009 | ||
3009 | inline bool | 3010 | inline bool |
3010 | match(uint mask, uint state) { | 3011 | match(uint mask, uint state) { |
3012 | state &= ~(ignoremod); | ||
3013 | |||
3011 | if(mask == XK_NO_MOD && state) | 3014 | if(mask == XK_NO_MOD && state) |
3012 | return false; | 3015 | return false; |
3013 | if(mask != XK_ANY_MOD && mask != XK_NO_MOD && !state) | 3016 | if(mask != XK_ANY_MOD && mask != XK_NO_MOD && !state) |