[hackers] [st] Add KAM sequence || "Roberto E. Vargas Caballero"

From: <hg_AT_suckless.org>
Date: Mon, 24 Sep 2012 10:32:05 +0200 (CEST)

changeset: 326:6c99547e89c2
user: "Roberto E. Vargas Caballero" <k0ga_AT_shike2.com>
date: Mon Sep 24 10:28:05 2012 +0200
files: st.c
description:
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(-)
diff -r ed3819c7839a -r 6c99547e89c2 st.c
--- a/st.c	Mon Sep 24 10:27:22 2012 +0200
+++ b/st.c	Mon Sep 24 10:28:05 2012 +0200
_AT_@ -110,7 +110,8 @@
 	MODE_MOUSEBTN    = 32,
 	MODE_MOUSEMOTION = 64,
 	MODE_MOUSE       = 32|64,
-	MODE_REVERSE     = 128
+	MODE_REVERSE     = 128,
+	MODE_KBDLOCK     = 256
 };
 
 enum escape_state {
_AT_@ -1328,6 +1329,9 @@
 			}
 		} else {
 			switch(*args) {
+			case 2:
+				MODBIT(term.mode, set, MODE_KBDLOCK);
+				break;
 			case 4:
 				MODBIT(term.mode, set, MODE_INSERT);
 				break;
_AT_@ -2257,6 +2261,8 @@
 	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);
Received on Mon Sep 24 2012 - 10:32:05 CEST

This archive was generated by hypermail 2.3.0 : Mon Sep 24 2012 - 10:36:10 CEST