st

Patched version of https://st.suckless.org/
git clone https://git.inz.fi/st/
Log | Files | Refs | README | LICENSE

commit 4389f2eb1b27f7a210e1f631e703c48a8ca8d50b
parent 88bb76c1bccbc8bb68b6776062cd2ef28bda8561
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 15 Nov 2012 15:36:20 +0100

Use XK_ANY_MOD instead of XK_NO_MOD in key definition

Usually terminal emulators don't generate any sequence for a combination
they don't have registered, for example Shift + Next, but st behavior
previous to the keyboard patch generates the sequence without the modifier,
in this example Next. This patch uses the XK_ANY_MOD in order to get this
same behaviour.
---
 config.def.h |  114 ++++++++++++++++++++++++++++++----------------------------
 1 file changed, 59 insertions(+), 55 deletions(-)
Diffstat:
Mconfig.def.h | 114+++++++++++++++++++++++++++++++++++++++++--------------------------------------
1 file changed, 59 insertions(+), 55 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -72,91 +72,95 @@ static unsigned int defaultucs = 257; * * 0: no value * * > 0: crlf mode is enabled * * < 0: crlf mode is disabled + * + * Be careful with the order of the definitons because st searchs in + * this table sequencially, so any XK_ANY_MOD must be in the last + * position for a key. */ /* key, mask, output, keypad, cursor, crlf */ static Key key[] = { /* keysym mask string keypad cursor crlf */ - { XK_KP_Home, XK_NO_MOD, "\033[H", 0, 0, 0}, { XK_KP_Home, ShiftMask, "\033[1;2H", 0, 0, 0}, - { XK_KP_Up, XK_NO_MOD, "\033Ox", +1, 0, 0}, - { XK_KP_Up, XK_NO_MOD, "\033[A", 0, -1, 0}, - { XK_KP_Up, XK_NO_MOD, "\033OA", 0, +1, 0}, - { XK_KP_Down, XK_NO_MOD, "\033Or", +1, 0, 0}, - { XK_KP_Down, XK_NO_MOD, "\033[B", 0, -1, 0}, - { XK_KP_Down, XK_NO_MOD, "\033OB", 0, +1, 0}, - { XK_KP_Left, XK_NO_MOD, "\033Ot", +1, 0, 0}, - { XK_KP_Left, XK_NO_MOD, "\033[D", 0, -1, 0}, - { XK_KP_Left, XK_NO_MOD, "\033OD", 0, +1, 0}, - { XK_KP_Right, XK_NO_MOD, "\033Ov", +1, 0, 0}, - { XK_KP_Right, XK_NO_MOD, "\033[C", 0, -1, 0}, - { XK_KP_Right, XK_NO_MOD, "\033OC", 0, +1, 0}, - { XK_KP_Prior, XK_NO_MOD, "\033[5~", 0, 0, 0}, + { XK_KP_Home, XK_ANY_MOD, "\033[H", 0, 0, 0}, + { XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0, 0}, + { XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1, 0}, + { XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1, 0}, + { XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0, 0}, + { XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1, 0}, + { XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1, 0}, + { XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0, 0}, + { XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1, 0}, + { XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1, 0}, + { XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0, 0}, + { XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1, 0}, + { XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1, 0}, { XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0, 0}, - { XK_KP_Begin, XK_NO_MOD, "\033[E", 0, 0, 0}, - { XK_KP_End, XK_NO_MOD, "\033[4~", 0, 0, 0}, + { XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0}, + { XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0, 0}, { XK_KP_End, ShiftMask, "\033[1;2F", 0, 0, 0}, - { XK_KP_Next, XK_NO_MOD, "\033[6~", 0, 0, 0}, + { XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0, 0}, { XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0, 0}, - { XK_KP_Insert, XK_NO_MOD, "\033[2~", 0, 0, 0}, + { XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0}, { XK_KP_Insert, ShiftMask, "\033[2;2~", 0, 0, 0}, - { XK_KP_Delete, XK_NO_MOD, "\033[3~", 0, 0, 0}, + { XK_KP_Insert, XK_ANY_MOD, "\033[2~", 0, 0, 0}, { XK_KP_Delete, ShiftMask, "\033[3;2~", 0, 0, 0}, - { XK_KP_Multiply, XK_NO_MOD, "\033Oj", +1, 0, 0}, - { XK_KP_Add, XK_NO_MOD, "\033Ok", +1, 0, 0}, - { XK_KP_Enter, XK_NO_MOD, "\033OM", +1, 0, 0}, - { XK_KP_Enter, XK_NO_MOD, "\n", -1, 0, -1}, - { XK_KP_Enter, XK_NO_MOD, "\r\n", -1, 0, 0}, - { XK_KP_Subtract, XK_NO_MOD, "\033Om", +1, 0, 0}, - { XK_KP_Decimal, XK_NO_MOD, "\033On", +1, 0, 0}, - { XK_KP_Divide, XK_NO_MOD, "\033Oo", +1, 0, 0}, - { XK_KP_0, XK_NO_MOD, "\033Op", +1, 0, 0}, - { XK_KP_1, XK_NO_MOD, "\033Oq", +1, 0, 0}, - { XK_KP_2, XK_NO_MOD, "\033Or", +1, 0, 0}, - { XK_KP_3, XK_NO_MOD, "\033Os", +1, 0, 0}, - { XK_KP_4, XK_NO_MOD, "\033Ot", +1, 0, 0}, - { XK_KP_5, XK_NO_MOD, "\033Ou", +1, 0, 0}, - { XK_KP_6, XK_NO_MOD, "\033Ov", +1, 0, 0}, - { XK_KP_7, XK_NO_MOD, "\033Ow", +1, 0, 0}, - { XK_KP_8, XK_NO_MOD, "\033Ox", +1, 0, 0}, - { XK_KP_9, XK_NO_MOD, "\033Oy", +1, 0, 0}, - { XK_BackSpace, XK_NO_MOD, "\177", 0, 0, 0}, - { XK_Up, XK_NO_MOD, "\033[A", 0, -1, 0}, - { XK_Up, XK_NO_MOD, "\033OA", 0, +1, 0}, + { XK_KP_Delete, XK_ANY_MOD, "\033[3~", 0, 0, 0}, + { XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +1, 0, 0}, + { XK_KP_Add, XK_ANY_MOD, "\033Ok", +1, 0, 0}, + { XK_KP_Enter, XK_ANY_MOD, "\033OM", +1, 0, 0}, + { XK_KP_Enter, XK_ANY_MOD, "\n", -1, 0, +1}, + { XK_KP_Enter, XK_ANY_MOD, "\r\n", -1, 0, -1}, + { XK_KP_Subtract, XK_ANY_MOD, "\033Om", +1, 0, 0}, + { XK_KP_Decimal, XK_ANY_MOD, "\033On", +1, 0, 0}, + { XK_KP_Divide, XK_ANY_MOD, "\033Oo", +1, 0, 0}, + { XK_KP_0, XK_ANY_MOD, "\033Op", +1, 0, 0}, + { XK_KP_1, XK_ANY_MOD, "\033Oq", +1, 0, 0}, + { XK_KP_2, XK_ANY_MOD, "\033Or", +1, 0, 0}, + { XK_KP_3, XK_ANY_MOD, "\033Os", +1, 0, 0}, + { XK_KP_4, XK_ANY_MOD, "\033Ot", +1, 0, 0}, + { XK_KP_5, XK_ANY_MOD, "\033Ou", +1, 0, 0}, + { XK_KP_6, XK_ANY_MOD, "\033Ov", +1, 0, 0}, + { XK_KP_7, XK_ANY_MOD, "\033Ow", +1, 0, 0}, + { XK_KP_8, XK_ANY_MOD, "\033Ox", +1, 0, 0}, + { XK_KP_9, XK_ANY_MOD, "\033Oy", +1, 0, 0}, + { XK_BackSpace, XK_ANY_MOD, "\177", 0, 0, 0}, { XK_Up, ShiftMask, "\033[1;2A", 0, 0, 0}, { XK_Up, ControlMask, "\033[1;5A", 0, 0, 0}, { XK_Up, Mod1Mask, "\033[1;3A", 0, 0, 0}, - { XK_Down, XK_NO_MOD, "\033[B", 0, -1, 0}, - { XK_Down, XK_NO_MOD, "\033OB", 0, +1, 0}, + { XK_Up, XK_ANY_MOD, "\033[A", 0, -1, 0}, + { XK_Up, XK_ANY_MOD, "\033OA", 0, +1, 0}, { XK_Down, ShiftMask, "\033[1;2B", 0, 0, 0}, { XK_Down, ControlMask, "\033[1;5B", 0, 0, 0}, { XK_Down, Mod1Mask, "\033[1;3B", 0, 0, 0}, - { XK_Left, XK_NO_MOD, "\033[D", 0, -1, 0}, - { XK_Left, XK_NO_MOD, "\033OD", 0, +1, 0}, + { XK_Down, XK_ANY_MOD, "\033[B", 0, -1, 0}, + { XK_Down, XK_ANY_MOD, "\033OB", 0, +1, 0}, { XK_Left, ShiftMask, "\033[1;2D", 0, 0, 0}, { XK_Left, ControlMask, "\033[1;5D", 0, 0, 0}, { XK_Left, Mod1Mask, "\033[1;3D", 0, 0, 0}, - { XK_Right, XK_NO_MOD, "\033[C", 0, -1, 0}, - { XK_Right, XK_NO_MOD, "\033OC", 0, +1, 0}, + { XK_Left, XK_ANY_MOD, "\033[D", 0, -1, 0}, + { XK_Left, XK_ANY_MOD, "\033OD", 0, +1, 0}, { XK_Right, ShiftMask, "\033[1;2C", 0, 0, 0}, { XK_Right, ControlMask, "\033[1;5C", 0, 0, 0}, { XK_Right, Mod1Mask, "\033[1;3C", 0, 0, 0}, + { XK_Right, XK_ANY_MOD, "\033[C", 0, -1, 0}, + { XK_Right, XK_ANY_MOD, "\033OC", 0, +1, 0}, { XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0, 0}, - { XK_Return, XK_NO_MOD, "\n", 0, 0, -1}, - { XK_Return, XK_NO_MOD, "\r\n", 0, 0, +1}, - { XK_Return, Mod1Mask, "\033\n", 0, 0, -1}, - { XK_Return, Mod1Mask, "\033\r\n", 0, 0, +1}, - { XK_Insert, XK_NO_MOD, "\033[2~", 0, 0, 0}, + { XK_Return, Mod1Mask, "\033\n", 0, 0, +1}, + { XK_Return, Mod1Mask, "\033\r\n", 0, 0, -1}, + { XK_Return, XK_ANY_MOD, "\n", 0, 0, +1}, + { XK_Return, XK_ANY_MOD, "\r\n", 0, 0, -1}, { XK_Insert, ShiftMask, "\033[2;2~", 0, 0, 0}, - { XK_Delete, XK_NO_MOD, "\033[3~", 0, 0, 0}, + { XK_Insert, XK_ANY_MOD, "\033[2~", 0, 0, 0}, { XK_Delete, ShiftMask, "\033[3;2~", 0, 0, 0}, - { XK_Home, XK_NO_MOD, "\033[H", 0, 0, 0}, + { XK_Delete, XK_ANY_MOD, "\033[3~", 0, 0, 0}, { XK_Home, ShiftMask, "\033[1;2H", 0, 0, 0}, - { XK_End, XK_NO_MOD, "\033[4~", 0, 0, 0}, + { XK_Home, XK_ANY_MOD, "\033[H", 0, 0, 0}, { XK_End, ShiftMask, "\033[1;2F", 0, 0, 0}, + { XK_End, XK_ANY_MOD, "\033[4~", 0, 0, 0}, { XK_Prior, XK_NO_MOD, "\033[5~", 0, 0, 0}, - { XK_Next, XK_NO_MOD, "\033[6~", 0, 0, 0}, { XK_Next, ShiftMask, "\033[6;2~", 0, 0, 0}, + { XK_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0}, { XK_F1, XK_NO_MOD, "\033OP" , 0, 0, 0}, { XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0, 0}, { XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0, 0},