[hackers] [st] Fix keypad mode and cursor mode || "Roberto E. Vargas Caballero"

From: <hg_AT_suckless.org>
Date: Tue, 13 Nov 2012 20:08:51 +0100 (CET)

changeset: 399:bed4588c42a3
user: "Roberto E. Vargas Caballero" <k0ga_AT_shike2.com>
date: Tue Nov 13 20:04:34 2012 +0100
files: st.c st.info
description:
Fix keypad mode and cursor mode
Keypad mode is used for detecting when keys in the auxiliary keypad are
pressed, while cursor mode is used for detecting when a cursor is pressed,
but they are different modes.

St was mixing both modes and DECPAM and DECPNM modified the cursor mode, and
this was incorrect.
---
 st.c    |    5 +++--
 st.info |    4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)
diff -r a6486f657de6 -r bed4588c42a3 st.c
--- a/st.c	Tue Nov 13 20:04:26 2012 +0100
+++ b/st.c	Tue Nov 13 20:04:34 2012 +0100
_AT_@ -121,7 +121,8 @@
 	MODE_REVERSE     = 128,
 	MODE_KBDLOCK     = 256,
 	MODE_HIDE	 = 512,
-	MODE_ECHO	 = 1024
+	MODE_ECHO	 = 1024,
+	MODE_APPCURSOR	 = 2048
 };
 
 enum escape_state {
_AT_@ -1471,7 +1472,7 @@
 			switch(*args) {
 				break;
 			case 1: /* DECCKM -- Cursor key */
-				MODBIT(term.mode, set, MODE_APPKEYPAD);
+				MODBIT(term.mode, set, MODE_APPCURSOR);
 				break;
 			case 5: /* DECSCNM -- Reverse video */
 				mode = term.mode;
diff -r a6486f657de6 -r bed4588c42a3 st.info
--- a/st.info	Tue Nov 13 20:04:26 2012 +0100
+++ b/st.info	Tue Nov 13 20:04:34 2012 +0100
_AT_@ -89,7 +89,7 @@
 	ritm=\E[23m,
 	rmacs=\E(B,
 	rmcup=\E[?1049l,
-#	rmkx=\E>,
+	rmkx=\E[?1l\E>,
 	rmso=\E[23m,
 	rmul=\E[m,
 	rs1=\Ec,
_AT_@ -104,7 +104,7 @@
 	sitm=\E[3m,
 	smacs=\E(0,
 	smcup=\E[?1049h,
-#	smkx=\E=,
+	smkx=\E[?1h\E=,
 	smso=\E[3m,
 	smul=\E[4m,
 	tbc=\E[3g,
Received on Tue Nov 13 2012 - 20:08:51 CET

This archive was generated by hypermail 2.3.0 : Tue Nov 13 2012 - 20:12:07 CET