[hackers] [st] make the various combinations of arrow keys and shift/control/meta work || Manuel Tobias Schiller

From: <git_AT_suckless.org>
Date: Mon, 14 Nov 2016 19:58:24 +0100 (CET)

commit 740ada1447a0bf9eb7db327d9433fa0b96e0a4d8
Author: Manuel Tobias Schiller <mala_AT_hinterbergen.de>
AuthorDate: Mon Nov 14 18:25:51 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Mon Nov 14 19:58:02 2016 +0100

    make the various combinations of arrow keys and shift/control/meta work
    
    When using st with screen, I've bound next, prev, new screen to
    combinations like Ctrl-Alt-Right,Left,Down; xterm and (u)rxvt work fine
    when this combination of modifiers is pressed, st does not seem to
    transport all of them; a single modifier key is fine (e.g. Ctrl-Up,
    Alt-Down etc., but combinations are not). While I'm not terribly
    familiar with this, I have tried to hack config.h in a more or less
    systematic way to generate the expected sequences.

diff --git a/config.def.h b/config.def.h
index 7f465d1..32d107d 100644
--- a/config.def.h
+++ b/config.def.h
_AT_@ -280,23 +280,39 @@ static Key key[] = {
         { XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0, 0},
         { XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 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_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0, 0},
+ { XK_Up, ControlMask, "\033[1;5A", 0, 0, 0},
+ { XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0, 0},
+ { XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0, 0},
+ { XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0, 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_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0, 0},
+ { XK_Down, ControlMask, "\033[1;5B", 0, 0, 0},
+ { XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0, 0},
+ { XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0, 0},
+ { XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0, 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_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0, 0},
+ { XK_Left, ControlMask, "\033[1;5D", 0, 0, 0},
+ { XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0, 0},
+ { XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0, 0},
+ { XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0, 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, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0, 0},
+ { XK_Right, ControlMask, "\033[1;5C", 0, 0, 0},
+ { XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0, 0},
+ { XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0, 0},
+ { XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",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},
Received on Mon Nov 14 2016 - 19:58:24 CET

This archive was generated by hypermail 2.3.0 : Mon Nov 14 2016 - 20:00:17 CET