Xinqi Bao's Git
projects
/
st.git
/ diff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
e0ec2cf
)
Adding a way to ignore bits in the state.
author
Christoph Lohmann <
[email protected]
>
Sat, 16 Feb 2013 12:57:12 +0000
(13:57 +0100)
committer
Christoph Lohmann <
[email protected]
>
Sat, 16 Feb 2013 12:57:12 +0000
(13:57 +0100)
config.def.h
diff
|
blob
|
history
st.c
diff
|
blob
|
history
diff --git
a/config.def.h
b/config.def.h
index
93fc26d
..
07a22ed
100644
(file)
--- a/
config.def.h
+++ b/
config.def.h
@@
-104,6
+104,12
@@
static Shortcut shortcuts[] = {
*/
static KeySym mappedkeys[] = { -1 };
*/
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.
+ */
+uint ignoremod = XK_SWITCH_MOD;
+
/* key, mask, output, keypad, cursor, crlf */
static Key key[] = {
/* keysym mask string keypad cursor crlf */
/* key, mask, output, keypad, cursor, crlf */
static Key key[] = {
/* keysym mask string keypad cursor crlf */
diff --git
a/st.c
b/st.c
index
0ae2c90
..
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 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 */
#define REDRAW_TIMEOUT (80*1000) /* 80 ms */
@@
-3008,6
+3009,8
@@
focus(XEvent *ev) {
inline bool
match(uint mask, uint state) {
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)
if(mask == XK_NO_MOD && state)
return false;
if(mask != XK_ANY_MOD && mask != XK_NO_MOD && !state)