aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto E. Vargas Caballero <k0ga@shike2.com>2012-09-24 10:28:05 +0200
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2012-09-24 10:28:05 +0200
commit4dfbf487bf5d3779b6ba12ef969d8308aea1e036 (patch)
tree24b94ecc9007a497a04ac959f51dbe8eff27ef71
parente2fbd25f5194e0aaeb39c2083cec5354a21a6c80 (diff)
downloadst-4dfbf487bf5d3779b6ba12ef969d8308aea1e036.tar.gz
st-4dfbf487bf5d3779b6ba12ef969d8308aea1e036.tar.bz2
Add KAM sequence
This sequence lock/unlock the keyboard ignoring all the key pressing events from X server. --- st.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
-rw-r--r--st.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/st.c b/st.c
index 83edbb8..538ed9a 100644
--- a/st.c
+++ b/st.c
@@ -110,7 +110,8 @@ enum term_mode {
MODE_MOUSEBTN = 32,
MODE_MOUSEMOTION = 64,
MODE_MOUSE = 32|64,
- MODE_REVERSE = 128
+ MODE_REVERSE = 128,
+ MODE_KBDLOCK = 256
};
enum escape_state {
@@ -1328,6 +1329,9 @@ tsetmode(bool priv, bool set, int *args, int narg) {
}
} else {
switch(*args) {
+ case 2:
+ MODBIT(term.mode, set, MODE_KBDLOCK);
+ break;
case 4:
MODBIT(term.mode, set, MODE_INSERT);
break;
@@ -2257,6 +2261,8 @@ kpress(XEvent *ev) {
int shift;
Status status;
+ if (IS_SET(MODE_KBDLOCK))
+ return;
meta = e->state & Mod1Mask;
shift = e->state & ShiftMask;
len = XmbLookupString(xw.xic, e, buf, sizeof(buf), &ksym, &status);