aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto E. Vargas Caballero <k0ga@shike2.com>2012-11-16 11:32:17 +0100
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2012-11-16 11:32:17 +0100
commit55087ec2c7e78e4349259c4547aa58fa705fa915 (patch)
tree8b8eb08fee1f57fca174c9e9d45d0767497843c3
parent1cbe56026b1003d96d81c17e43ff21d1b0064b21 (diff)
downloadst-patched-55087ec2c7e78e4349259c4547aa58fa705fa915.tar.bz2
st-patched-55087ec2c7e78e4349259c4547aa58fa705fa915.tar.xz
st-patched-55087ec2c7e78e4349259c4547aa58fa705fa915.zip
Add application cursor sequences for Home
The commit 'Fixing some key issues with mc' fix the problem where mc didn't recognize home key because the generated code and the terminfo entry were different (terminfo khome = \E[1~ but generates \033[H). Home key in ansi mode should generate the sequence CUP (\033[H) to 0,0 (home position), but it is also interesting generate a application code which identifies the key. Real vt520 only generates the ansi sequence CUP, linux console generates only the application code \033[1~, xterm generates CUP in ansi mode and \033OH in cursor application mode, rxvt only generates the application code \033[7~. This patch sets CUP in ansi mode and \033[1~ in cursor application mode, so it can be used in both modes and the application mode value is similar to near values (insert = \033[2~, Prior = \033[5~, Next = \033[6~, End = \033[4~, Supr = \033[3). --- config.def.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
-rw-r--r--config.def.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/config.def.h b/config.def.h
index 3a2e38b..023634e 100644
--- a/config.def.h
+++ b/config.def.h
@@ -98,7 +98,8 @@ static KeySym mappedkeys[] = { -1 };
98static Key key[] = { 98static Key key[] = {
99 /* keysym mask string keypad cursor crlf */ 99 /* keysym mask string keypad cursor crlf */
100 { XK_KP_Home, ShiftMask, "\033[1;2H", 0, 0, 0}, 100 { XK_KP_Home, ShiftMask, "\033[1;2H", 0, 0, 0},
101 { XK_KP_Home, XK_ANY_MOD, "\033[H", 0, 0, 0}, 101 { XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1, 0},
102 { XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0},
102 { XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0, 0}, 103 { XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0, 0},
103 { XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1, 0}, 104 { XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1, 0},
104 { XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1, 0}, 105 { XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1, 0},
@@ -170,9 +171,9 @@ static Key key[] = {
170 { XK_Insert, XK_ANY_MOD, "\033[2~", 0, 0, 0}, 171 { XK_Insert, XK_ANY_MOD, "\033[2~", 0, 0, 0},
171 { XK_Delete, ShiftMask, "\033[3;2~", 0, 0, 0}, 172 { XK_Delete, ShiftMask, "\033[3;2~", 0, 0, 0},
172 { XK_Delete, XK_ANY_MOD, "\033[3~", 0, 0, 0}, 173 { XK_Delete, XK_ANY_MOD, "\033[3~", 0, 0, 0},
173 { XK_Home, XK_NO_MOD, "\033[1~", 0, 0, 0},
174 { XK_Home, ShiftMask, "\033[1;2H", 0, 0, 0}, 174 { XK_Home, ShiftMask, "\033[1;2H", 0, 0, 0},
175 { XK_Home, XK_ANY_MOD, "\033[H", 0, 0, 0}, 175 { XK_Home, XK_ANY_MOD, "\033[H", 0, -1, 0},
176 { XK_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0},
176 { XK_End, ShiftMask, "\033[1;2F", 0, 0, 0}, 177 { XK_End, ShiftMask, "\033[1;2F", 0, 0, 0},
177 { XK_End, XK_ANY_MOD, "\033[4~", 0, 0, 0}, 178 { XK_End, XK_ANY_MOD, "\033[4~", 0, 0, 0},
178 { XK_Prior, XK_NO_MOD, "\033[5~", 0, 0, 0}, 179 { XK_Prior, XK_NO_MOD, "\033[5~", 0, 0, 0},