1
0
mirror of https://github.com/alrayyes/st synced 2023-11-14 15:56:30 +00:00

feat: upgraded to 0.8.4

This commit is contained in:
Ryan Kes 2020-11-28 12:17:22 +01:00
parent 5b53d50751
commit c414fa19e0
12 changed files with 760 additions and 798 deletions

View File

@ -1,7 +1,7 @@
# Maintainer: Ryan Kes <alrayyes gmail com> # Maintainer: Ryan Kes <alrayyes gmail com>
pkgname=higherlearning-st pkgname=higherlearning-st
pkgver=0.8.2 pkgver=0.8.4
pkgrel=1 pkgrel=1
pkgdesc='A simple virtual terminal emulator for X.' pkgdesc='A simple virtual terminal emulator for X.'
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
@ -11,25 +11,26 @@ makedepends=('ncurses')
conflicts=('st') conflicts=('st')
url="http://st.suckless.org" url="http://st.suckless.org"
_patches=("st-clipboard-0.8.2.diff" _patches=("st-clipboard-0.8.3.diff"
"st-scrollback-20190122-3be4cf1.diff" "st-scrollback-20200419-72e3f6c.diff"
"st-scrollback-mouse-0.8.diff" "st-scrollback-mouse-20191024-a2c479c.diff"
"st-scrollback-mouse-altscreen-20200416-5703aa0.diff"
"st-vertcenter-20180320-6ac8c8a.diff" "st-vertcenter-20180320-6ac8c8a.diff"
"local-st-alpha-0.8.2.diff" "st-alpha-0.8.2.diff"
"local-disable-bold-italic-fonts.diff") )
source=("http://dl.suckless.org/st/st-$pkgver.tar.gz" source=("http://dl.suckless.org/st/st-$pkgver.tar.gz"
"config.h" "config.h"
"${_patches[@]}") "${_patches[@]}")
sha256sums=('aeb74e10aa11ed364e1bcc635a81a523119093e63befd2f231f8b0705b15bf35' sha256sums=('d42d3ceceb4d6a65e32e90a5336e3d446db612c3fbd9ebc1780bc6c9a03346a6'
'2842d6e1030ff0afad7420c4a93062e6da4e498295222005eae2581a38c45913' '2842d6e1030ff0afad7420c4a93062e6da4e498295222005eae2581a38c45913'
'7be1a09831f13361f5659aaad55110bde99b25c8ba826c11d1d7fcec21f32945' '0f5ce33953abce74a9da3088ea35bf067a9a4cfeb9fe6ea9800268ce69e436c0'
'30c9bcec5801614dd5cc8b96f470d7431e83d5d2af87bb2305df60082e5ab4ed' '1e41fe17a5ef5a8194eea07422b49d815e2c2bb4d58d84771f793be423005310'
'3fb38940cc3bad3f9cd1e2a0796ebd0e48950a07860ecf8523a5afd0cd1b5a44' '319458d980195d18fa0f81a6898d58f8d046c5ff982ab872d741f54bb60e267d'
'cb87eb654985da46ff63663407184402393ad3d3013c8795570552fe56a15b9d'
'04e6a4696293f668260b2f54a7240e379dbfabbc209de07bd5d4d57e9f513360' '04e6a4696293f668260b2f54a7240e379dbfabbc209de07bd5d4d57e9f513360'
'67b1bdc717e3f7914d04f0c72bc8a3f6efe91790248611c0a2c2dc905bf206bd' '9c5b4b4f23de80de78ca5ec3739dc6ce5e7f72666186cf4a9c6b614ac90fb285')
'59d5719a68e2f0e25c44b6ad9fab0d62ee8a6c5bcbcffb38176e9950cda16b15')
prepare() { prepare() {
cd $srcdir/st-$pkgver cd $srcdir/st-$pkgver

View File

@ -1,55 +1,32 @@
* My Suckless Terminal Build * My Suckless Terminal Build
:PROPERTIES:
:CUSTOM_ID: my-suckless-terminal-build
:END:
[[https://st.suckless.org][Suckless Terminal]] ** Description
[[https://www.archlinux.org/][Arch]] package with a few patches [[https://st.suckless.org][Suckless Terminal]] Arch package with a few patches installed to keep things nice:
installed to keep things nice:
- [[https://st.suckless.org/patches/alpha/][alpha]] - [[https://st.suckless.org/patches/alpha/][alpha]]
- [[https://st.suckless.org/patches/clipboard/][clipboard]] - [[https://st.suckless.org/patches/clipboard/][clipboard]]
- [[https://st.suckless.org/patches/solarized/][solarized]]
- [[https://st.suckless.org/patches/vertcenter/][vertcenter]] - [[https://st.suckless.org/patches/vertcenter/][vertcenter]]
- [[https://st.suckless.org/patches/scrollback/][scrollback]] - [[https://st.suckless.org/patches/scrollback/][scrollback]]
- [[https://st.suckless.org/patches/scrollback/][scrollback-mouse]] - [[https://st.suckless.org/patches/scrollback/][scrollback-mouse]]
- [[https://st.suckless.org/patches/disable_bold_italic_fonts/][disable_bold_italic_fonts]] - [[https://st.suckless.org/patches/scrollback/][scrollback-mouse-altscreen]]
** Terminal-specific mappings ** Terminal-specific mappings
:PROPERTIES:
:CUSTOM_ID: terminal-specific-mappings
:END:
- Scroll through history -- Shift+PageUp/PageDown or Shift+Mouse wheel - Scroll through history -- Shift+PageUp/PageDown or Shift+Mouse wheel
- Alt-k and Alt-j scroll back/foward in history one line at a time - Increase/decrease font size -- Ctrl+Shift+PageUp/PageDown
- Alt-u and Alt-d scroll back/foward in history a page at a time - Return to default font size -- Ctrl+Alt+Home
- Increase/decrease font size -- Shift+Alt+PageUp/PageDown
- Return to default font size -- Shift+Alt+Home
- Paste -- Shift+Insert - Paste -- Shift+Insert
** Installation ** Installation
:PROPERTIES:
:CUSTOM_ID: installation
:END:
#+BEGIN_SRC shell #+BEGIN_SRC shell
makepkg -si makepkg -si
#+END_SRC #+END_SRC
** Further Notes ** Further Notes
:PROPERTIES:
:CUSTOM_ID: further-notes
:END:
- Change the transparency value by modifying the =alpha= variable in [[https://github.com/alrayyes/st/blob/master/config.h][config.h]]. - Change the transparency value by modifying the =alpha= variable in [[https://github.com/alrayyes/st/blob/master/config.h][config.h]].
- Default font is [[https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/FiraCode][Fira Code Nerd Font Mono]] - Default font is [[https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/FiraCode][Fira Code Nerd Font Mono]]
- When modifying [[https://github.com/alrayyes/st/blob/master/config.h][config.h]] be sure to run =updpkgsums= to update checksums before - When modifying [[https://github.com/alrayyes/st/blob/master/config.h][config.h]] be sure to run =updpkgsums= to update checksums before
running =makepkg -si= running =makepkg -si=
** License ** License
:PROPERTIES:
:CUSTOM_ID: license
:END:
This theme is released under the MIT License. For more information read This theme is released under the MIT License. For more information read
the [[file:LICENSE.org][license]]. the [[file:LICENSE.org][license]].

577
config.h
View File

@ -5,25 +5,23 @@
* *
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/ */
static char *font = "FuraCode Nerd Font Mono:style=Regular:pixelsize=18:antialias=true:autohint=true"; static char *font =
"FuraCode Nerd Font "
/* disable bold, italic and roman fonts globally */ "Mono:style=Regular:pixelsize=18:antialias=true:autohint=true";
int disablebold = 0;
int disableitalic = 0;
int disableroman = 0;
static int borderpx = 2; static int borderpx = 2;
/* /*
* What program is execed by st depends of these precedence rules: * What program is execed by st depends of these precedence rules:
* 1: program passed with -e * 1: program passed with -e
* 2: utmp option * 2: scroll and/or utmp
* 3: SHELL environment variable * 3: SHELL environment variable
* 4: value of shell in /etc/passwd * 4: value of shell in /etc/passwd
* 5: value of shell in config.h * 5: value of shell in config.h
*/ */
static char *shell = "/bin/sh"; static char *shell = "/bin/sh";
char *utmp = NULL; char *utmp = NULL;
/* scroll program: to enable use a string like "scroll" */
char *scroll = NULL;
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400"; char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
/* identification sequence returned in DA and DECID */ /* identification sequence returned in DA and DECID */
@ -36,9 +34,9 @@ static float chscale = 1.0;
/* /*
* word delimiter string * word delimiter string
* *
* More advanced example: " `'\"()[]{}" * More advanced example: L" `'\"()[]{}"
*/ */
char *worddelimiters = " "; wchar_t *worddelimiters = L" ";
/* selection timeouts (in milliseconds) */ /* selection timeouts (in milliseconds) */
static unsigned int doubleclicktimeout = 300; static unsigned int doubleclicktimeout = 300;
@ -47,9 +45,18 @@ static unsigned int tripleclicktimeout = 600;
/* alt screens */ /* alt screens */
int allowaltscreen = 1; int allowaltscreen = 1;
/* frames per second st should at maximum draw to the screen */ /* allow certain non-interactive (insecure) window operations such as:
static unsigned int xfps = 120; setting the clipboard text */
static unsigned int actionfps = 30; int allowwindowops = 0;
/*
* draw latency range in ms - from new content/keypress/etc until drawing.
* within this range, st draws when content stops arriving (idle). mostly it's
* near minlatency, but it waits longer for slow updates to avoid partial draw.
* low minlatency will tear/flicker more, as it can "detect" idle too early.
*/
static double minlatency = 8;
static double maxlatency = 33;
/* /*
* blinking timeout (set to 0 to disable blinking) for the terminal blinking * blinking timeout (set to 0 to disable blinking) for the terminal blinking
@ -69,7 +76,7 @@ static unsigned int cursorthickness = 2;
static int bellvolume = 0; static int bellvolume = 0;
/* default TERM value */ /* default TERM value */
char *termname = "xterm-256color"; char *termname = "st-256color";
/* /*
* spaces per tab * spaces per tab
@ -93,32 +100,42 @@ float alpha = 0.8;
/* Terminal colors (16 first used in escape sequence) */ /* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = { static const char *colorname[] = {
"#282828", /* hard contrast: #1d2021 / soft contrast: #32302f */ /* 8 normal colors */
"#cc241d", "black",
"#98971a", "red3",
"#d79921", "green3",
"#458588", "yellow3",
"#b16286", "blue2",
"#689d6a", "magenta3",
"#a89984", "cyan3",
"#928374", "gray90",
"#fb4934",
"#b8bb26", /* 8 bright colors */
"#fabd2f", "gray50",
"#83a598", "red",
"#d3869b", "green",
"#8ec07c", "yellow",
"#ebdbb2", "#5c5cff",
"magenta",
"cyan",
"white",
[255] = 0,
/* more colors can be added after 255 to use with DefaultXX */
"#cccccc",
"#555555",
"black",
}; };
/* /*
* Default colors (colorname index) * Default colors (colorname index)
* foreground, background, cursor, reverse cursor * foreground, background, cursor, reverse cursor
*/ */
unsigned int defaultfg = 12; unsigned int defaultfg = 7;
unsigned int defaultbg = 258; unsigned int defaultbg = 258;
static unsigned int defaultcs = 14; static unsigned int defaultcs = 256;
static unsigned int defaultrcs = 15; static unsigned int defaultrcs = 257;
/* /*
* Default shape of cursor * Default shape of cursor
@ -149,46 +166,48 @@ static unsigned int mousebg = 0;
*/ */
static unsigned int defaultattr = 11; static unsigned int defaultattr = 11;
/*
* Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set).
* Note that if you want to use ShiftMask with selmasks, set this to an other
* modifier, set to 0 to not use it.
*/
static uint forcemousemod = ShiftMask;
/* /*
* Internal mouse shortcuts. * Internal mouse shortcuts.
* Beware that overloading Button1 will disable the selection. * Beware that overloading Button1 will disable the selection.
*/ */
static MouseShortcut mshortcuts[] = { static MouseShortcut mshortcuts[] = {
/* button mask string */ /* mask button function argument release */
{ Button4, XK_NO_MOD, "\031" }, {XK_ANY_MOD, Button4, kscrollup, {.i = 1}, 0, /* !alt */ -1},
{ Button5, XK_NO_MOD, "\005" }, {XK_ANY_MOD, Button5, kscrolldown, {.i = 1}, 0, /* !alt */ -1},
}; {XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1},
{ShiftMask, Button4, ttysend, {.s = "\033[5;2~"}},
MouseKey mkeys[] = { {XK_ANY_MOD, Button4, ttysend, {.s = "\031"}},
/* button mask function argument */ {ShiftMask, Button5, ttysend, {.s = "\033[6;2~"}},
{ Button4, ShiftMask, kscrollup, {.i = 1} }, {XK_ANY_MOD, Button5, ttysend, {.s = "\005"}},
{ Button5, ShiftMask, kscrolldown, {.i = 1} },
}; };
/* Internal keyboard shortcuts. */ /* Internal keyboard shortcuts. */
#define MODKEY Mod1Mask #define MODKEY Mod1Mask
#define TERMMOD (ControlMask | ShiftMask)
static Shortcut shortcuts[] = { static Shortcut shortcuts[] = {
/* mask keysym function argument */ /* mask keysym function argument */
{ XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, {XK_ANY_MOD, XK_Break, sendbreak, {.i = 0}},
{ ControlMask, XK_Print, toggleprinter, {.i = 0} }, {ControlMask, XK_Print, toggleprinter, {.i = 0}},
{ ShiftMask, XK_Print, printscreen, {.i = 0} }, {ShiftMask, XK_Print, printscreen, {.i = 0}},
{ XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, {XK_ANY_MOD, XK_Print, printsel, {.i = 0}},
{ MODKEY|ShiftMask, XK_Prior, zoom, {.f = +1} }, {TERMMOD, XK_Prior, zoom, {.f = +1}},
{ MODKEY|ShiftMask, XK_Next, zoom, {.f = -1} }, {TERMMOD, XK_Next, zoom, {.f = -1}},
{ MODKEY|ShiftMask, XK_Home, zoomreset, {.f = 0} }, {TERMMOD, XK_Home, zoomreset, {.f = 0}},
{ ShiftMask, XK_Insert, selpaste, {.i = 0} }, {TERMMOD, XK_C, clipcopy, {.i = 0}},
{ MODKEY|ShiftMask, XK_Insert, clippaste, {.i = 0} }, {TERMMOD, XK_V, clippaste, {.i = 0}},
{ MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} }, {TERMMOD, XK_Y, selpaste, {.i = 0}},
{ MODKEY|ShiftMask, XK_V, clippaste, {.i = 0} }, {ShiftMask, XK_Insert, selpaste, {.i = 0}},
{ MODKEY, XK_Num_Lock, numlock, {.i = 0} }, {TERMMOD, XK_Num_Lock, numlock, {.i = 0}},
// { MODKEY, XK_Control_L, iso14755, {.i = 0} }, {ShiftMask, XK_Page_Up, kscrollup, {.i = -1}},
{ ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, {ShiftMask, XK_Page_Down, kscrolldown, {.i = -1}},
{ ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} },
{ MODKEY, XK_k, kscrollup, {.i = 1} },
{ MODKEY, XK_j, kscrolldown, {.i = 1} },
{ MODKEY, XK_u, kscrollup, {.i = -1} },
{ MODKEY, XK_d, kscrolldown, {.i = -1} },
}; };
/* /*
@ -206,10 +225,6 @@ static Shortcut shortcuts[] = {
* * 0: no value * * 0: no value
* * > 0: cursor application mode enabled * * > 0: cursor application mode enabled
* * < 0: cursor application mode disabled * * < 0: cursor application mode disabled
* crlf value
* * 0: no value
* * > 0: crlf mode is enabled
* * < 0: crlf mode is disabled
* *
* Be careful with the order of the definitions because st searches in * Be careful with the order of the definitions because st searches in
* this table sequentially, so any XK_ANY_MOD must be in the last * this table sequentially, so any XK_ANY_MOD must be in the last
@ -220,20 +235,13 @@ static Shortcut shortcuts[] = {
* If you want keys other than the X11 function keys (0xFD00 - 0xFFFF) * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
* to be mapped below, add them to this array. * to be mapped below, add them to this array.
*/ */
static KeySym mappedkeys[] = { -1 }; static KeySym mappedkeys[] = {-1};
/* /*
* State bits to ignore when matching key or button events. By default, * State bits to ignore when matching key or button events. By default,
* numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored. * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
*/ */
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; static uint ignoremod = Mod2Mask | XK_SWITCH_MOD;
/*
* Override mouse-select while mask is active (when MODE_MOUSE is set).
* Note that if you want to use ShiftMask with selmasks, set this to an other
* modifier, set to 0 to not use it.
*/
static uint forceselmod = ShiftMask;
/* /*
* This is the huge key array which defines all compatibility to the Linux * This is the huge key array which defines all compatibility to the Linux
@ -241,215 +249,215 @@ static uint forceselmod = ShiftMask;
*/ */
static Key key[] = { static Key key[] = {
/* keysym mask string appkey appcursor */ /* keysym mask string appkey appcursor */
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1}, {XK_KP_Home, ShiftMask, "\033[2J", 0, -1},
{ XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1}, {XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1},
{ XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1}, {XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1},
{ XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1}, {XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1},
{ XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0}, {XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0},
{ XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1}, {XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1},
{ XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1}, {XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1},
{ XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0}, {XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0},
{ XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1}, {XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1},
{ XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1}, {XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1},
{ XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0}, {XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0},
{ XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1}, {XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1},
{ XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1}, {XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1},
{ XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0}, {XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0},
{ XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1}, {XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1},
{ XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1}, {XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1},
{ XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0}, {XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0},
{ XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0}, {XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
{ XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0}, {XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0},
{ XK_KP_End, ControlMask, "\033[J", -1, 0}, {XK_KP_End, ControlMask, "\033[J", -1, 0},
{ XK_KP_End, ControlMask, "\033[1;5F", +1, 0}, {XK_KP_End, ControlMask, "\033[1;5F", +1, 0},
{ XK_KP_End, ShiftMask, "\033[K", -1, 0}, {XK_KP_End, ShiftMask, "\033[K", -1, 0},
{ XK_KP_End, ShiftMask, "\033[1;2F", +1, 0}, {XK_KP_End, ShiftMask, "\033[1;2F", +1, 0},
{ XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0}, {XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0},
{ XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0}, {XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0},
{ XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0}, {XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0},
{ XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0}, {XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0},
{ XK_KP_Insert, ShiftMask, "\033[4l", -1, 0}, {XK_KP_Insert, ShiftMask, "\033[4l", -1, 0},
{ XK_KP_Insert, ControlMask, "\033[L", -1, 0}, {XK_KP_Insert, ControlMask, "\033[L", -1, 0},
{ XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0}, {XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0}, {XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0}, {XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
{ XK_KP_Delete, ControlMask, "\033[M", -1, 0}, {XK_KP_Delete, ControlMask, "\033[M", -1, 0},
{ XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0}, {XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0},
{ XK_KP_Delete, ShiftMask, "\033[2K", -1, 0}, {XK_KP_Delete, ShiftMask, "\033[2K", -1, 0},
{ XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0}, {XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0}, {XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, {XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
{ XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0}, {XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0},
{ XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0}, {XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0}, {XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0}, {XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0},
{ XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0}, {XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0},
{ XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0}, {XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0},
{ XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0}, {XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0},
{ XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0}, {XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0},
{ XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0}, {XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0},
{ XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0}, {XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0},
{ XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0}, {XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0},
{ XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0}, {XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0},
{ XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0}, {XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0},
{ XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0}, {XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0},
{ XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0}, {XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0},
{ XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0}, {XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0},
{ XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0}, {XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0},
{ XK_Up, ShiftMask, "\033[1;2A", 0, 0}, {XK_Up, ShiftMask, "\033[1;2A", 0, 0},
{ XK_Up, Mod1Mask, "\033[1;3A", 0, 0}, {XK_Up, Mod1Mask, "\033[1;3A", 0, 0},
{ XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0}, {XK_Up, ShiftMask | Mod1Mask, "\033[1;4A", 0, 0},
{ XK_Up, ControlMask, "\033[1;5A", 0, 0}, {XK_Up, ControlMask, "\033[1;5A", 0, 0},
{ XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0}, {XK_Up, ShiftMask | ControlMask, "\033[1;6A", 0, 0},
{ XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0}, {XK_Up, ControlMask | Mod1Mask, "\033[1;7A", 0, 0},
{ XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0}, {XK_Up, ShiftMask | ControlMask | Mod1Mask, "\033[1;8A", 0, 0},
{ XK_Up, XK_ANY_MOD, "\033[A", 0, -1}, {XK_Up, XK_ANY_MOD, "\033[A", 0, -1},
{ XK_Up, XK_ANY_MOD, "\033OA", 0, +1}, {XK_Up, XK_ANY_MOD, "\033OA", 0, +1},
{ XK_Down, ShiftMask, "\033[1;2B", 0, 0}, {XK_Down, ShiftMask, "\033[1;2B", 0, 0},
{ XK_Down, Mod1Mask, "\033[1;3B", 0, 0}, {XK_Down, Mod1Mask, "\033[1;3B", 0, 0},
{ XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0}, {XK_Down, ShiftMask | Mod1Mask, "\033[1;4B", 0, 0},
{ XK_Down, ControlMask, "\033[1;5B", 0, 0}, {XK_Down, ControlMask, "\033[1;5B", 0, 0},
{ XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0}, {XK_Down, ShiftMask | ControlMask, "\033[1;6B", 0, 0},
{ XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0}, {XK_Down, ControlMask | Mod1Mask, "\033[1;7B", 0, 0},
{ XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0}, {XK_Down, ShiftMask | ControlMask | Mod1Mask, "\033[1;8B", 0, 0},
{ XK_Down, XK_ANY_MOD, "\033[B", 0, -1}, {XK_Down, XK_ANY_MOD, "\033[B", 0, -1},
{ XK_Down, XK_ANY_MOD, "\033OB", 0, +1}, {XK_Down, XK_ANY_MOD, "\033OB", 0, +1},
{ XK_Left, ShiftMask, "\033[1;2D", 0, 0}, {XK_Left, ShiftMask, "\033[1;2D", 0, 0},
{ XK_Left, Mod1Mask, "\033[1;3D", 0, 0}, {XK_Left, Mod1Mask, "\033[1;3D", 0, 0},
{ XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0}, {XK_Left, ShiftMask | Mod1Mask, "\033[1;4D", 0, 0},
{ XK_Left, ControlMask, "\033[1;5D", 0, 0}, {XK_Left, ControlMask, "\033[1;5D", 0, 0},
{ XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0}, {XK_Left, ShiftMask | ControlMask, "\033[1;6D", 0, 0},
{ XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0}, {XK_Left, ControlMask | Mod1Mask, "\033[1;7D", 0, 0},
{ XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0}, {XK_Left, ShiftMask | ControlMask | Mod1Mask, "\033[1;8D", 0, 0},
{ XK_Left, XK_ANY_MOD, "\033[D", 0, -1}, {XK_Left, XK_ANY_MOD, "\033[D", 0, -1},
{ XK_Left, XK_ANY_MOD, "\033OD", 0, +1}, {XK_Left, XK_ANY_MOD, "\033OD", 0, +1},
{ XK_Right, ShiftMask, "\033[1;2C", 0, 0}, {XK_Right, ShiftMask, "\033[1;2C", 0, 0},
{ XK_Right, Mod1Mask, "\033[1;3C", 0, 0}, {XK_Right, Mod1Mask, "\033[1;3C", 0, 0},
{ XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0}, {XK_Right, ShiftMask | Mod1Mask, "\033[1;4C", 0, 0},
{ XK_Right, ControlMask, "\033[1;5C", 0, 0}, {XK_Right, ControlMask, "\033[1;5C", 0, 0},
{ XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0}, {XK_Right, ShiftMask | ControlMask, "\033[1;6C", 0, 0},
{ XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0}, {XK_Right, ControlMask | Mod1Mask, "\033[1;7C", 0, 0},
{ XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0}, {XK_Right, ShiftMask | ControlMask | Mod1Mask, "\033[1;8C", 0, 0},
{ XK_Right, XK_ANY_MOD, "\033[C", 0, -1}, {XK_Right, XK_ANY_MOD, "\033[C", 0, -1},
{ XK_Right, XK_ANY_MOD, "\033OC", 0, +1}, {XK_Right, XK_ANY_MOD, "\033OC", 0, +1},
{ XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0}, {XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0},
{ XK_Return, Mod1Mask, "\033\r", 0, 0}, {XK_Return, Mod1Mask, "\033\r", 0, 0},
{ XK_Return, XK_ANY_MOD, "\r", 0, 0}, {XK_Return, XK_ANY_MOD, "\r", 0, 0},
{ XK_Insert, ShiftMask, "\033[4l", -1, 0}, {XK_Insert, ShiftMask, "\033[4l", -1, 0},
{ XK_Insert, ShiftMask, "\033[2;2~", +1, 0}, {XK_Insert, ShiftMask, "\033[2;2~", +1, 0},
{ XK_Insert, ControlMask, "\033[L", -1, 0}, {XK_Insert, ControlMask, "\033[L", -1, 0},
{ XK_Insert, ControlMask, "\033[2;5~", +1, 0}, {XK_Insert, ControlMask, "\033[2;5~", +1, 0},
{ XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0}, {XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
{ XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0}, {XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
{ XK_Delete, ControlMask, "\033[M", -1, 0}, {XK_Delete, ControlMask, "\033[M", -1, 0},
{ XK_Delete, ControlMask, "\033[3;5~", +1, 0}, {XK_Delete, ControlMask, "\033[3;5~", +1, 0},
{ XK_Delete, ShiftMask, "\033[2K", -1, 0}, {XK_Delete, ShiftMask, "\033[2K", -1, 0},
{ XK_Delete, ShiftMask, "\033[3;2~", +1, 0}, {XK_Delete, ShiftMask, "\033[3;2~", +1, 0},
{ XK_Delete, XK_ANY_MOD, "\033[P", -1, 0}, {XK_Delete, XK_ANY_MOD, "\033[P", -1, 0},
{ XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, {XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
{ XK_BackSpace, XK_NO_MOD, "\177", 0, 0}, {XK_BackSpace, XK_NO_MOD, "\177", 0, 0},
{ XK_BackSpace, Mod1Mask, "\033\177", 0, 0}, {XK_BackSpace, Mod1Mask, "\033\177", 0, 0},
{ XK_Home, ShiftMask, "\033[2J", 0, -1}, {XK_Home, ShiftMask, "\033[2J", 0, -1},
{ XK_Home, ShiftMask, "\033[1;2H", 0, +1}, {XK_Home, ShiftMask, "\033[1;2H", 0, +1},
{ XK_Home, XK_ANY_MOD, "\033[H", 0, -1}, {XK_Home, XK_ANY_MOD, "\033[H", 0, -1},
{ XK_Home, XK_ANY_MOD, "\033[1~", 0, +1}, {XK_Home, XK_ANY_MOD, "\033[1~", 0, +1},
{ XK_End, ControlMask, "\033[J", -1, 0}, {XK_End, ControlMask, "\033[J", -1, 0},
{ XK_End, ControlMask, "\033[1;5F", +1, 0}, {XK_End, ControlMask, "\033[1;5F", +1, 0},
{ XK_End, ShiftMask, "\033[K", -1, 0}, {XK_End, ShiftMask, "\033[K", -1, 0},
{ XK_End, ShiftMask, "\033[1;2F", +1, 0}, {XK_End, ShiftMask, "\033[1;2F", +1, 0},
{ XK_End, XK_ANY_MOD, "\033[4~", 0, 0}, {XK_End, XK_ANY_MOD, "\033[4~", 0, 0},
{ XK_Prior, ControlMask, "\033[5;5~", 0, 0}, {XK_Prior, ControlMask, "\033[5;5~", 0, 0},
{ XK_Prior, ShiftMask, "\033[5;2~", 0, 0}, {XK_Prior, ShiftMask, "\033[5;2~", 0, 0},
{ XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0}, {XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
{ XK_Next, ControlMask, "\033[6;5~", 0, 0}, {XK_Next, ControlMask, "\033[6;5~", 0, 0},
{ XK_Next, ShiftMask, "\033[6;2~", 0, 0}, {XK_Next, ShiftMask, "\033[6;2~", 0, 0},
{ XK_Next, XK_ANY_MOD, "\033[6~", 0, 0}, {XK_Next, XK_ANY_MOD, "\033[6~", 0, 0},
{ XK_F1, XK_NO_MOD, "\033OP" , 0, 0}, {XK_F1, XK_NO_MOD, "\033OP", 0, 0},
{ XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0}, {XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0},
{ XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0}, {XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0},
{ XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0}, {XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0},
{ XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0}, {XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0},
{ XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0}, {XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0},
{ XK_F2, XK_NO_MOD, "\033OQ" , 0, 0}, {XK_F2, XK_NO_MOD, "\033OQ", 0, 0},
{ XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0}, {XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0},
{ XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0}, {XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0},
{ XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0}, {XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0},
{ XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0}, {XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0},
{ XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0}, {XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0},
{ XK_F3, XK_NO_MOD, "\033OR" , 0, 0}, {XK_F3, XK_NO_MOD, "\033OR", 0, 0},
{ XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0}, {XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0},
{ XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0}, {XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0},
{ XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0}, {XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0},
{ XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0}, {XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0},
{ XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0}, {XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0},
{ XK_F4, XK_NO_MOD, "\033OS" , 0, 0}, {XK_F4, XK_NO_MOD, "\033OS", 0, 0},
{ XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0}, {XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0},
{ XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0}, {XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0},
{ XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0}, {XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0},
{ XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0}, {XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0},
{ XK_F5, XK_NO_MOD, "\033[15~", 0, 0}, {XK_F5, XK_NO_MOD, "\033[15~", 0, 0},
{ XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0}, {XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0},
{ XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0}, {XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0},
{ XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0}, {XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0},
{ XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0}, {XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0},
{ XK_F6, XK_NO_MOD, "\033[17~", 0, 0}, {XK_F6, XK_NO_MOD, "\033[17~", 0, 0},
{ XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0}, {XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0},
{ XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0}, {XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0},
{ XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0}, {XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0},
{ XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0}, {XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0},
{ XK_F7, XK_NO_MOD, "\033[18~", 0, 0}, {XK_F7, XK_NO_MOD, "\033[18~", 0, 0},
{ XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0}, {XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0},
{ XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0}, {XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0},
{ XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0}, {XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0},
{ XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0}, {XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0},
{ XK_F8, XK_NO_MOD, "\033[19~", 0, 0}, {XK_F8, XK_NO_MOD, "\033[19~", 0, 0},
{ XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0}, {XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0},
{ XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0}, {XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0},
{ XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0}, {XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0},
{ XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0}, {XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0},
{ XK_F9, XK_NO_MOD, "\033[20~", 0, 0}, {XK_F9, XK_NO_MOD, "\033[20~", 0, 0},
{ XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0}, {XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0},
{ XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0}, {XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0},
{ XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0}, {XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0},
{ XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0}, {XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0},
{ XK_F10, XK_NO_MOD, "\033[21~", 0, 0}, {XK_F10, XK_NO_MOD, "\033[21~", 0, 0},
{ XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0}, {XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0},
{ XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0}, {XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0},
{ XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0}, {XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0},
{ XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0}, {XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0},
{ XK_F11, XK_NO_MOD, "\033[23~", 0, 0}, {XK_F11, XK_NO_MOD, "\033[23~", 0, 0},
{ XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0}, {XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0},
{ XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0}, {XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0},
{ XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0}, {XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0},
{ XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0}, {XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0},
{ XK_F12, XK_NO_MOD, "\033[24~", 0, 0}, {XK_F12, XK_NO_MOD, "\033[24~", 0, 0},
{ XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0}, {XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0},
{ XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0}, {XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0},
{ XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0}, {XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0},
{ XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0}, {XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0},
{ XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0}, {XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0},
{ XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0}, {XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0},
{ XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0}, {XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0},
{ XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0}, {XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0},
{ XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0}, {XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0},
{ XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0}, {XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0},
{ XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0}, {XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0},
{ XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0}, {XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0},
{ XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0}, {XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0},
{ XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0}, {XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0},
{ XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0}, {XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0},
{ XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0}, {XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0},
{ XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0}, {XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0},
{ XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0}, {XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0},
{ XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0}, {XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0},
{ XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0}, {XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0},
{ XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0}, {XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0},
{ XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0}, {XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0},
{ XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0}, {XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0},
{ XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0}, {XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0},
{ XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0}, {XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0},
{ XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0}, {XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0},
{ XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0}, {XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0},
}; };
/* /*
@ -467,7 +475,6 @@ static uint selmasks[] = {
* Printable characters in ASCII, used to estimate the advance width * Printable characters in ASCII, used to estimate the advance width
* of single wide characters. * of single wide characters.
*/ */
static char ascii_printable[] = static char ascii_printable[] = " !\"#$%&'()*+,-./0123456789:;<=>?"
" !\"#$%&'()*+,-./0123456789:;<=>?"
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
"`abcdefghijklmnopqrstuvwxyz{|}~"; "`abcdefghijklmnopqrstuvwxyz{|}~";

View File

@ -5,25 +5,23 @@
* *
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/ */
static char *font = "FuraCode Nerd Font Mono:style=Regular:pixelsize=12:antialias=true:autohint=true"; static char *font =
"FuraCode Nerd Font "
/* disable bold, italic and roman fonts globally */ "Mono:style=Regular:pixelsize=12:antialias=true:autohint=true";
int disablebold = 0;
int disableitalic = 0;
int disableroman = 0;
static int borderpx = 2; static int borderpx = 2;
/* /*
* What program is execed by st depends of these precedence rules: * What program is execed by st depends of these precedence rules:
* 1: program passed with -e * 1: program passed with -e
* 2: utmp option * 2: scroll and/or utmp
* 3: SHELL environment variable * 3: SHELL environment variable
* 4: value of shell in /etc/passwd * 4: value of shell in /etc/passwd
* 5: value of shell in config.h * 5: value of shell in config.h
*/ */
static char *shell = "/bin/sh"; static char *shell = "/bin/sh";
char *utmp = NULL; char *utmp = NULL;
/* scroll program: to enable use a string like "scroll" */
char *scroll = NULL;
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400"; char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
/* identification sequence returned in DA and DECID */ /* identification sequence returned in DA and DECID */
@ -36,9 +34,9 @@ static float chscale = 1.0;
/* /*
* word delimiter string * word delimiter string
* *
* More advanced example: " `'\"()[]{}" * More advanced example: L" `'\"()[]{}"
*/ */
char *worddelimiters = " "; wchar_t *worddelimiters = L" ";
/* selection timeouts (in milliseconds) */ /* selection timeouts (in milliseconds) */
static unsigned int doubleclicktimeout = 300; static unsigned int doubleclicktimeout = 300;
@ -47,9 +45,18 @@ static unsigned int tripleclicktimeout = 600;
/* alt screens */ /* alt screens */
int allowaltscreen = 1; int allowaltscreen = 1;
/* frames per second st should at maximum draw to the screen */ /* allow certain non-interactive (insecure) window operations such as:
static unsigned int xfps = 120; setting the clipboard text */
static unsigned int actionfps = 30; int allowwindowops = 0;
/*
* draw latency range in ms - from new content/keypress/etc until drawing.
* within this range, st draws when content stops arriving (idle). mostly it's
* near minlatency, but it waits longer for slow updates to avoid partial draw.
* low minlatency will tear/flicker more, as it can "detect" idle too early.
*/
static double minlatency = 8;
static double maxlatency = 33;
/* /*
* blinking timeout (set to 0 to disable blinking) for the terminal blinking * blinking timeout (set to 0 to disable blinking) for the terminal blinking
@ -69,7 +76,7 @@ static unsigned int cursorthickness = 2;
static int bellvolume = 0; static int bellvolume = 0;
/* default TERM value */ /* default TERM value */
char *termname = "xterm-256color"; char *termname = "st-256color";
/* /*
* spaces per tab * spaces per tab
@ -93,32 +100,42 @@ float alpha = 0.8;
/* Terminal colors (16 first used in escape sequence) */ /* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = { static const char *colorname[] = {
"#282828", /* hard contrast: #1d2021 / soft contrast: #32302f */ /* 8 normal colors */
"#cc241d", "black",
"#98971a", "red3",
"#d79921", "green3",
"#458588", "yellow3",
"#b16286", "blue2",
"#689d6a", "magenta3",
"#a89984", "cyan3",
"#928374", "gray90",
"#fb4934",
"#b8bb26", /* 8 bright colors */
"#fabd2f", "gray50",
"#83a598", "red",
"#d3869b", "green",
"#8ec07c", "yellow",
"#ebdbb2", "#5c5cff",
"magenta",
"cyan",
"white",
[255] = 0,
/* more colors can be added after 255 to use with DefaultXX */
"#cccccc",
"#555555",
"black",
}; };
/* /*
* Default colors (colorname index) * Default colors (colorname index)
* foreground, background, cursor, reverse cursor * foreground, background, cursor, reverse cursor
*/ */
unsigned int defaultfg = 12; unsigned int defaultfg = 7;
unsigned int defaultbg = 258; unsigned int defaultbg = 258;
static unsigned int defaultcs = 14; static unsigned int defaultcs = 256;
static unsigned int defaultrcs = 15; static unsigned int defaultrcs = 257;
/* /*
* Default shape of cursor * Default shape of cursor
@ -149,46 +166,48 @@ static unsigned int mousebg = 0;
*/ */
static unsigned int defaultattr = 11; static unsigned int defaultattr = 11;
/*
* Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set).
* Note that if you want to use ShiftMask with selmasks, set this to an other
* modifier, set to 0 to not use it.
*/
static uint forcemousemod = ShiftMask;
/* /*
* Internal mouse shortcuts. * Internal mouse shortcuts.
* Beware that overloading Button1 will disable the selection. * Beware that overloading Button1 will disable the selection.
*/ */
static MouseShortcut mshortcuts[] = { static MouseShortcut mshortcuts[] = {
/* button mask string */ /* mask button function argument release */
{ Button4, XK_NO_MOD, "\031" }, {XK_ANY_MOD, Button4, kscrollup, {.i = 1}, 0, /* !alt */ -1},
{ Button5, XK_NO_MOD, "\005" }, {XK_ANY_MOD, Button5, kscrolldown, {.i = 1}, 0, /* !alt */ -1},
}; {XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1},
{ShiftMask, Button4, ttysend, {.s = "\033[5;2~"}},
MouseKey mkeys[] = { {XK_ANY_MOD, Button4, ttysend, {.s = "\031"}},
/* button mask function argument */ {ShiftMask, Button5, ttysend, {.s = "\033[6;2~"}},
{ Button4, ShiftMask, kscrollup, {.i = 1} }, {XK_ANY_MOD, Button5, ttysend, {.s = "\005"}},
{ Button5, ShiftMask, kscrolldown, {.i = 1} },
}; };
/* Internal keyboard shortcuts. */ /* Internal keyboard shortcuts. */
#define MODKEY Mod1Mask #define MODKEY Mod1Mask
#define TERMMOD (ControlMask | ShiftMask)
static Shortcut shortcuts[] = { static Shortcut shortcuts[] = {
/* mask keysym function argument */ /* mask keysym function argument */
{ XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, {XK_ANY_MOD, XK_Break, sendbreak, {.i = 0}},
{ ControlMask, XK_Print, toggleprinter, {.i = 0} }, {ControlMask, XK_Print, toggleprinter, {.i = 0}},
{ ShiftMask, XK_Print, printscreen, {.i = 0} }, {ShiftMask, XK_Print, printscreen, {.i = 0}},
{ XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, {XK_ANY_MOD, XK_Print, printsel, {.i = 0}},
{ MODKEY|ShiftMask, XK_Prior, zoom, {.f = +1} }, {TERMMOD, XK_Prior, zoom, {.f = +1}},
{ MODKEY|ShiftMask, XK_Next, zoom, {.f = -1} }, {TERMMOD, XK_Next, zoom, {.f = -1}},
{ MODKEY|ShiftMask, XK_Home, zoomreset, {.f = 0} }, {TERMMOD, XK_Home, zoomreset, {.f = 0}},
{ ShiftMask, XK_Insert, selpaste, {.i = 0} }, {TERMMOD, XK_C, clipcopy, {.i = 0}},
{ MODKEY|ShiftMask, XK_Insert, clippaste, {.i = 0} }, {TERMMOD, XK_V, clippaste, {.i = 0}},
{ MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} }, {TERMMOD, XK_Y, selpaste, {.i = 0}},
{ MODKEY|ShiftMask, XK_V, clippaste, {.i = 0} }, {ShiftMask, XK_Insert, selpaste, {.i = 0}},
{ MODKEY, XK_Num_Lock, numlock, {.i = 0} }, {TERMMOD, XK_Num_Lock, numlock, {.i = 0}},
// { MODKEY, XK_Control_L, iso14755, {.i = 0} }, {ShiftMask, XK_Page_Up, kscrollup, {.i = -1}},
{ ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, {ShiftMask, XK_Page_Down, kscrolldown, {.i = -1}},
{ ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} },
{ MODKEY, XK_k, kscrollup, {.i = 1} },
{ MODKEY, XK_j, kscrolldown, {.i = 1} },
{ MODKEY, XK_u, kscrollup, {.i = -1} },
{ MODKEY, XK_d, kscrolldown, {.i = -1} },
}; };
/* /*
@ -206,10 +225,6 @@ static Shortcut shortcuts[] = {
* * 0: no value * * 0: no value
* * > 0: cursor application mode enabled * * > 0: cursor application mode enabled
* * < 0: cursor application mode disabled * * < 0: cursor application mode disabled
* crlf value
* * 0: no value
* * > 0: crlf mode is enabled
* * < 0: crlf mode is disabled
* *
* Be careful with the order of the definitions because st searches in * Be careful with the order of the definitions because st searches in
* this table sequentially, so any XK_ANY_MOD must be in the last * this table sequentially, so any XK_ANY_MOD must be in the last
@ -220,20 +235,13 @@ static Shortcut shortcuts[] = {
* If you want keys other than the X11 function keys (0xFD00 - 0xFFFF) * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
* to be mapped below, add them to this array. * to be mapped below, add them to this array.
*/ */
static KeySym mappedkeys[] = { -1 }; static KeySym mappedkeys[] = {-1};
/* /*
* State bits to ignore when matching key or button events. By default, * State bits to ignore when matching key or button events. By default,
* numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored. * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
*/ */
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; static uint ignoremod = Mod2Mask | XK_SWITCH_MOD;
/*
* Override mouse-select while mask is active (when MODE_MOUSE is set).
* Note that if you want to use ShiftMask with selmasks, set this to an other
* modifier, set to 0 to not use it.
*/
static uint forceselmod = ShiftMask;
/* /*
* This is the huge key array which defines all compatibility to the Linux * This is the huge key array which defines all compatibility to the Linux
@ -241,215 +249,215 @@ static uint forceselmod = ShiftMask;
*/ */
static Key key[] = { static Key key[] = {
/* keysym mask string appkey appcursor */ /* keysym mask string appkey appcursor */
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1}, {XK_KP_Home, ShiftMask, "\033[2J", 0, -1},
{ XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1}, {XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1},
{ XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1}, {XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1},
{ XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1}, {XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1},
{ XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0}, {XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0},
{ XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1}, {XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1},
{ XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1}, {XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1},
{ XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0}, {XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0},
{ XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1}, {XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1},
{ XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1}, {XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1},
{ XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0}, {XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0},
{ XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1}, {XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1},
{ XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1}, {XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1},
{ XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0}, {XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0},
{ XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1}, {XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1},
{ XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1}, {XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1},
{ XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0}, {XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0},
{ XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0}, {XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
{ XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0}, {XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0},
{ XK_KP_End, ControlMask, "\033[J", -1, 0}, {XK_KP_End, ControlMask, "\033[J", -1, 0},
{ XK_KP_End, ControlMask, "\033[1;5F", +1, 0}, {XK_KP_End, ControlMask, "\033[1;5F", +1, 0},
{ XK_KP_End, ShiftMask, "\033[K", -1, 0}, {XK_KP_End, ShiftMask, "\033[K", -1, 0},
{ XK_KP_End, ShiftMask, "\033[1;2F", +1, 0}, {XK_KP_End, ShiftMask, "\033[1;2F", +1, 0},
{ XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0}, {XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0},
{ XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0}, {XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0},
{ XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0}, {XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0},
{ XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0}, {XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0},
{ XK_KP_Insert, ShiftMask, "\033[4l", -1, 0}, {XK_KP_Insert, ShiftMask, "\033[4l", -1, 0},
{ XK_KP_Insert, ControlMask, "\033[L", -1, 0}, {XK_KP_Insert, ControlMask, "\033[L", -1, 0},
{ XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0}, {XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0}, {XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0}, {XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
{ XK_KP_Delete, ControlMask, "\033[M", -1, 0}, {XK_KP_Delete, ControlMask, "\033[M", -1, 0},
{ XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0}, {XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0},
{ XK_KP_Delete, ShiftMask, "\033[2K", -1, 0}, {XK_KP_Delete, ShiftMask, "\033[2K", -1, 0},
{ XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0}, {XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0}, {XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, {XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
{ XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0}, {XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0},
{ XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0}, {XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0}, {XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0}, {XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0},
{ XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0}, {XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0},
{ XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0}, {XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0},
{ XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0}, {XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0},
{ XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0}, {XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0},
{ XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0}, {XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0},
{ XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0}, {XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0},
{ XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0}, {XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0},
{ XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0}, {XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0},
{ XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0}, {XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0},
{ XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0}, {XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0},
{ XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0}, {XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0},
{ XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0}, {XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0},
{ XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0}, {XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0},
{ XK_Up, ShiftMask, "\033[1;2A", 0, 0}, {XK_Up, ShiftMask, "\033[1;2A", 0, 0},
{ XK_Up, Mod1Mask, "\033[1;3A", 0, 0}, {XK_Up, Mod1Mask, "\033[1;3A", 0, 0},
{ XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0}, {XK_Up, ShiftMask | Mod1Mask, "\033[1;4A", 0, 0},
{ XK_Up, ControlMask, "\033[1;5A", 0, 0}, {XK_Up, ControlMask, "\033[1;5A", 0, 0},
{ XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0}, {XK_Up, ShiftMask | ControlMask, "\033[1;6A", 0, 0},
{ XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0}, {XK_Up, ControlMask | Mod1Mask, "\033[1;7A", 0, 0},
{ XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0}, {XK_Up, ShiftMask | ControlMask | Mod1Mask, "\033[1;8A", 0, 0},
{ XK_Up, XK_ANY_MOD, "\033[A", 0, -1}, {XK_Up, XK_ANY_MOD, "\033[A", 0, -1},
{ XK_Up, XK_ANY_MOD, "\033OA", 0, +1}, {XK_Up, XK_ANY_MOD, "\033OA", 0, +1},
{ XK_Down, ShiftMask, "\033[1;2B", 0, 0}, {XK_Down, ShiftMask, "\033[1;2B", 0, 0},
{ XK_Down, Mod1Mask, "\033[1;3B", 0, 0}, {XK_Down, Mod1Mask, "\033[1;3B", 0, 0},
{ XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0}, {XK_Down, ShiftMask | Mod1Mask, "\033[1;4B", 0, 0},
{ XK_Down, ControlMask, "\033[1;5B", 0, 0}, {XK_Down, ControlMask, "\033[1;5B", 0, 0},
{ XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0}, {XK_Down, ShiftMask | ControlMask, "\033[1;6B", 0, 0},
{ XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0}, {XK_Down, ControlMask | Mod1Mask, "\033[1;7B", 0, 0},
{ XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0}, {XK_Down, ShiftMask | ControlMask | Mod1Mask, "\033[1;8B", 0, 0},
{ XK_Down, XK_ANY_MOD, "\033[B", 0, -1}, {XK_Down, XK_ANY_MOD, "\033[B", 0, -1},
{ XK_Down, XK_ANY_MOD, "\033OB", 0, +1}, {XK_Down, XK_ANY_MOD, "\033OB", 0, +1},
{ XK_Left, ShiftMask, "\033[1;2D", 0, 0}, {XK_Left, ShiftMask, "\033[1;2D", 0, 0},
{ XK_Left, Mod1Mask, "\033[1;3D", 0, 0}, {XK_Left, Mod1Mask, "\033[1;3D", 0, 0},
{ XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0}, {XK_Left, ShiftMask | Mod1Mask, "\033[1;4D", 0, 0},
{ XK_Left, ControlMask, "\033[1;5D", 0, 0}, {XK_Left, ControlMask, "\033[1;5D", 0, 0},
{ XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0}, {XK_Left, ShiftMask | ControlMask, "\033[1;6D", 0, 0},
{ XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0}, {XK_Left, ControlMask | Mod1Mask, "\033[1;7D", 0, 0},
{ XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0}, {XK_Left, ShiftMask | ControlMask | Mod1Mask, "\033[1;8D", 0, 0},
{ XK_Left, XK_ANY_MOD, "\033[D", 0, -1}, {XK_Left, XK_ANY_MOD, "\033[D", 0, -1},
{ XK_Left, XK_ANY_MOD, "\033OD", 0, +1}, {XK_Left, XK_ANY_MOD, "\033OD", 0, +1},
{ XK_Right, ShiftMask, "\033[1;2C", 0, 0}, {XK_Right, ShiftMask, "\033[1;2C", 0, 0},
{ XK_Right, Mod1Mask, "\033[1;3C", 0, 0}, {XK_Right, Mod1Mask, "\033[1;3C", 0, 0},
{ XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0}, {XK_Right, ShiftMask | Mod1Mask, "\033[1;4C", 0, 0},
{ XK_Right, ControlMask, "\033[1;5C", 0, 0}, {XK_Right, ControlMask, "\033[1;5C", 0, 0},
{ XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0}, {XK_Right, ShiftMask | ControlMask, "\033[1;6C", 0, 0},
{ XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0}, {XK_Right, ControlMask | Mod1Mask, "\033[1;7C", 0, 0},
{ XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0}, {XK_Right, ShiftMask | ControlMask | Mod1Mask, "\033[1;8C", 0, 0},
{ XK_Right, XK_ANY_MOD, "\033[C", 0, -1}, {XK_Right, XK_ANY_MOD, "\033[C", 0, -1},
{ XK_Right, XK_ANY_MOD, "\033OC", 0, +1}, {XK_Right, XK_ANY_MOD, "\033OC", 0, +1},
{ XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0}, {XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0},
{ XK_Return, Mod1Mask, "\033\r", 0, 0}, {XK_Return, Mod1Mask, "\033\r", 0, 0},
{ XK_Return, XK_ANY_MOD, "\r", 0, 0}, {XK_Return, XK_ANY_MOD, "\r", 0, 0},
{ XK_Insert, ShiftMask, "\033[4l", -1, 0}, {XK_Insert, ShiftMask, "\033[4l", -1, 0},
{ XK_Insert, ShiftMask, "\033[2;2~", +1, 0}, {XK_Insert, ShiftMask, "\033[2;2~", +1, 0},
{ XK_Insert, ControlMask, "\033[L", -1, 0}, {XK_Insert, ControlMask, "\033[L", -1, 0},
{ XK_Insert, ControlMask, "\033[2;5~", +1, 0}, {XK_Insert, ControlMask, "\033[2;5~", +1, 0},
{ XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0}, {XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
{ XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0}, {XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
{ XK_Delete, ControlMask, "\033[M", -1, 0}, {XK_Delete, ControlMask, "\033[M", -1, 0},
{ XK_Delete, ControlMask, "\033[3;5~", +1, 0}, {XK_Delete, ControlMask, "\033[3;5~", +1, 0},
{ XK_Delete, ShiftMask, "\033[2K", -1, 0}, {XK_Delete, ShiftMask, "\033[2K", -1, 0},
{ XK_Delete, ShiftMask, "\033[3;2~", +1, 0}, {XK_Delete, ShiftMask, "\033[3;2~", +1, 0},
{ XK_Delete, XK_ANY_MOD, "\033[P", -1, 0}, {XK_Delete, XK_ANY_MOD, "\033[P", -1, 0},
{ XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, {XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
{ XK_BackSpace, XK_NO_MOD, "\177", 0, 0}, {XK_BackSpace, XK_NO_MOD, "\177", 0, 0},
{ XK_BackSpace, Mod1Mask, "\033\177", 0, 0}, {XK_BackSpace, Mod1Mask, "\033\177", 0, 0},
{ XK_Home, ShiftMask, "\033[2J", 0, -1}, {XK_Home, ShiftMask, "\033[2J", 0, -1},
{ XK_Home, ShiftMask, "\033[1;2H", 0, +1}, {XK_Home, ShiftMask, "\033[1;2H", 0, +1},
{ XK_Home, XK_ANY_MOD, "\033[H", 0, -1}, {XK_Home, XK_ANY_MOD, "\033[H", 0, -1},
{ XK_Home, XK_ANY_MOD, "\033[1~", 0, +1}, {XK_Home, XK_ANY_MOD, "\033[1~", 0, +1},
{ XK_End, ControlMask, "\033[J", -1, 0}, {XK_End, ControlMask, "\033[J", -1, 0},
{ XK_End, ControlMask, "\033[1;5F", +1, 0}, {XK_End, ControlMask, "\033[1;5F", +1, 0},
{ XK_End, ShiftMask, "\033[K", -1, 0}, {XK_End, ShiftMask, "\033[K", -1, 0},
{ XK_End, ShiftMask, "\033[1;2F", +1, 0}, {XK_End, ShiftMask, "\033[1;2F", +1, 0},
{ XK_End, XK_ANY_MOD, "\033[4~", 0, 0}, {XK_End, XK_ANY_MOD, "\033[4~", 0, 0},
{ XK_Prior, ControlMask, "\033[5;5~", 0, 0}, {XK_Prior, ControlMask, "\033[5;5~", 0, 0},
{ XK_Prior, ShiftMask, "\033[5;2~", 0, 0}, {XK_Prior, ShiftMask, "\033[5;2~", 0, 0},
{ XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0}, {XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
{ XK_Next, ControlMask, "\033[6;5~", 0, 0}, {XK_Next, ControlMask, "\033[6;5~", 0, 0},
{ XK_Next, ShiftMask, "\033[6;2~", 0, 0}, {XK_Next, ShiftMask, "\033[6;2~", 0, 0},
{ XK_Next, XK_ANY_MOD, "\033[6~", 0, 0}, {XK_Next, XK_ANY_MOD, "\033[6~", 0, 0},
{ XK_F1, XK_NO_MOD, "\033OP" , 0, 0}, {XK_F1, XK_NO_MOD, "\033OP", 0, 0},
{ XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0}, {XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0},
{ XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0}, {XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0},
{ XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0}, {XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0},
{ XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0}, {XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0},
{ XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0}, {XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0},
{ XK_F2, XK_NO_MOD, "\033OQ" , 0, 0}, {XK_F2, XK_NO_MOD, "\033OQ", 0, 0},
{ XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0}, {XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0},
{ XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0}, {XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0},
{ XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0}, {XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0},
{ XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0}, {XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0},
{ XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0}, {XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0},
{ XK_F3, XK_NO_MOD, "\033OR" , 0, 0}, {XK_F3, XK_NO_MOD, "\033OR", 0, 0},
{ XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0}, {XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0},
{ XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0}, {XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0},
{ XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0}, {XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0},
{ XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0}, {XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0},
{ XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0}, {XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0},
{ XK_F4, XK_NO_MOD, "\033OS" , 0, 0}, {XK_F4, XK_NO_MOD, "\033OS", 0, 0},
{ XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0}, {XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0},
{ XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0}, {XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0},
{ XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0}, {XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0},
{ XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0}, {XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0},
{ XK_F5, XK_NO_MOD, "\033[15~", 0, 0}, {XK_F5, XK_NO_MOD, "\033[15~", 0, 0},
{ XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0}, {XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0},
{ XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0}, {XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0},
{ XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0}, {XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0},
{ XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0}, {XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0},
{ XK_F6, XK_NO_MOD, "\033[17~", 0, 0}, {XK_F6, XK_NO_MOD, "\033[17~", 0, 0},
{ XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0}, {XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0},
{ XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0}, {XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0},
{ XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0}, {XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0},
{ XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0}, {XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0},
{ XK_F7, XK_NO_MOD, "\033[18~", 0, 0}, {XK_F7, XK_NO_MOD, "\033[18~", 0, 0},
{ XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0}, {XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0},
{ XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0}, {XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0},
{ XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0}, {XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0},
{ XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0}, {XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0},
{ XK_F8, XK_NO_MOD, "\033[19~", 0, 0}, {XK_F8, XK_NO_MOD, "\033[19~", 0, 0},
{ XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0}, {XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0},
{ XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0}, {XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0},
{ XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0}, {XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0},
{ XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0}, {XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0},
{ XK_F9, XK_NO_MOD, "\033[20~", 0, 0}, {XK_F9, XK_NO_MOD, "\033[20~", 0, 0},
{ XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0}, {XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0},
{ XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0}, {XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0},
{ XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0}, {XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0},
{ XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0}, {XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0},
{ XK_F10, XK_NO_MOD, "\033[21~", 0, 0}, {XK_F10, XK_NO_MOD, "\033[21~", 0, 0},
{ XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0}, {XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0},
{ XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0}, {XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0},
{ XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0}, {XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0},
{ XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0}, {XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0},
{ XK_F11, XK_NO_MOD, "\033[23~", 0, 0}, {XK_F11, XK_NO_MOD, "\033[23~", 0, 0},
{ XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0}, {XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0},
{ XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0}, {XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0},
{ XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0}, {XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0},
{ XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0}, {XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0},
{ XK_F12, XK_NO_MOD, "\033[24~", 0, 0}, {XK_F12, XK_NO_MOD, "\033[24~", 0, 0},
{ XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0}, {XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0},
{ XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0}, {XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0},
{ XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0}, {XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0},
{ XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0}, {XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0},
{ XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0}, {XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0},
{ XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0}, {XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0},
{ XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0}, {XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0},
{ XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0}, {XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0},
{ XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0}, {XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0},
{ XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0}, {XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0},
{ XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0}, {XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0},
{ XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0}, {XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0},
{ XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0}, {XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0},
{ XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0}, {XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0},
{ XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0}, {XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0},
{ XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0}, {XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0},
{ XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0}, {XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0},
{ XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0}, {XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0},
{ XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0}, {XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0},
{ XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0}, {XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0},
{ XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0}, {XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0},
{ XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0}, {XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0},
{ XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0}, {XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0},
{ XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0}, {XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0},
{ XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0}, {XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0},
{ XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0}, {XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0},
{ XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0}, {XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0},
}; };
/* /*
@ -467,7 +475,6 @@ static uint selmasks[] = {
* Printable characters in ASCII, used to estimate the advance width * Printable characters in ASCII, used to estimate the advance width
* of single wide characters. * of single wide characters.
*/ */
static char ascii_printable[] = static char ascii_printable[] = " !\"#$%&'()*+,-./0123456789:;<=>?"
" !\"#$%&'()*+,-./0123456789:;<=>?"
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
"`abcdefghijklmnopqrstuvwxyz{|}~"; "`abcdefghijklmnopqrstuvwxyz{|}~";

View File

@ -1,43 +0,0 @@
diff -up a/config.def.h b/config.def.h
--- a/config.def.h
+++ b/config.def.h
@@ -6,6 +6,12 @@
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
+
+/* disable bold, italic and roman fonts globally */
+int disablebold = 0;
+int disableitalic = 0;
+int disableroman = 0;
+
static int borderpx = 2;
/*
diff -up a/x.c b/x.c
--- a/x.c
+++ b/x.c
@@ -231,6 +231,11 @@ static char *usedfont = NULL;
static double usedfontsize = 0;
static double defaultfontsize = 0;
+/* declared in config.h */
+extern int disablebold;
+extern int disableitalic;
+extern int disableroman;
+
static char *opt_alpha = NULL;
static char *opt_class = NULL;
static char **opt_cmd = NULL;
@@ -979,7 +984,10 @@ xloadfonts(char *fontstr, double fontsiz
win.cyo = ceilf(dc.font.height * (chscale - 1) / 2);
FcPatternDel(pattern, FC_SLANT);
- FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
+ if (!disableitalic)
+ FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
+ if (!disableroman)
+ FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN);
if (xloadfont(&dc.ifont, pattern))
die("can't open font %s\n", fontstr);

View File

@ -1,4 +1,5 @@
diff -up a/config.def.h b/config.def.h diff --git a/config.def.h b/config.def.h
index 0e01717..e116631 100644
--- a/config.def.h --- a/config.def.h
+++ b/config.def.h +++ b/config.def.h
@@ -82,6 +82,9 @@ char *termname = "st-256color"; @@ -82,6 +82,9 @@ char *termname = "st-256color";
@ -28,7 +29,8 @@ diff -up a/config.def.h b/config.def.h
static unsigned int defaultcs = 256; static unsigned int defaultcs = 256;
static unsigned int defaultrcs = 257; static unsigned int defaultrcs = 257;
diff -up a/config.mk b/config.mk diff --git a/config.mk b/config.mk
index 0cbb002..1d2f0e2 100644
--- a/config.mk --- a/config.mk
+++ b/config.mk +++ b/config.mk
@@ -16,7 +16,7 @@ PKG_CONFIG = pkg-config @@ -16,7 +16,7 @@ PKG_CONFIG = pkg-config
@ -40,19 +42,20 @@ diff -up a/config.mk b/config.mk
`$(PKG_CONFIG) --libs fontconfig` \ `$(PKG_CONFIG) --libs fontconfig` \
`$(PKG_CONFIG) --libs freetype2` `$(PKG_CONFIG) --libs freetype2`
diff -up a/st.h b/st.h diff --git a/st.h b/st.h
index 38c61c4..b7634ab 100644
--- a/st.h --- a/st.h
+++ b/st.h +++ b/st.h
@@ -129,4 +129,5 @@ extern char *termname; @@ -120,3 +120,4 @@ extern char *termname;
extern unsigned int tabspaces; extern unsigned int tabspaces;
extern unsigned int defaultfg; extern unsigned int defaultfg;
extern unsigned int defaultbg; extern unsigned int defaultbg;
+extern float alpha; +extern float alpha;
extern MouseKey mkeys[]; diff --git a/x.c b/x.c
diff -up a/x.c b/x.c index 0422421..588dec3 100644
--- a/x.c --- a/x.c
+++ b/x.c +++ b/x.c
@@ -99,6 +99,7 @@ typedef struct { @@ -98,6 +98,7 @@ typedef struct {
XSetWindowAttributes attrs; XSetWindowAttributes attrs;
int scr; int scr;
int isfixed; /* is fixed geometry? */ int isfixed; /* is fixed geometry? */
@ -60,7 +63,7 @@ diff -up a/x.c b/x.c
int l, t; /* left and top offset */ int l, t; /* left and top offset */
int gm; /* geometry mask */ int gm; /* geometry mask */
} XWindow; } XWindow;
@@ -230,6 +231,7 @@ static char *usedfont = NULL; @@ -229,6 +230,7 @@ static char *usedfont = NULL;
static double usedfontsize = 0; static double usedfontsize = 0;
static double defaultfontsize = 0; static double defaultfontsize = 0;
@ -68,7 +71,7 @@ diff -up a/x.c b/x.c
static char *opt_class = NULL; static char *opt_class = NULL;
static char **opt_cmd = NULL; static char **opt_cmd = NULL;
static char *opt_embed = NULL; static char *opt_embed = NULL;
@@ -700,7 +702,7 @@ xresize(int col, int row) @@ -688,7 +690,7 @@ xresize(int col, int row)
XFreePixmap(xw.dpy, xw.buf); XFreePixmap(xw.dpy, xw.buf);
xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
@ -77,7 +80,7 @@ diff -up a/x.c b/x.c
XftDrawChange(xw.draw, xw.buf); XftDrawChange(xw.draw, xw.buf);
xclear(0, 0, win.w, win.h); xclear(0, 0, win.w, win.h);
@@ -760,6 +762,13 @@ xloadcols(void) @@ -748,6 +750,13 @@ xloadcols(void)
else else
die("could not allocate color %d\n", i); die("could not allocate color %d\n", i);
} }
@ -91,7 +94,7 @@ diff -up a/x.c b/x.c
loaded = 1; loaded = 1;
} }
@@ -1017,12 +1026,25 @@ xinit(int cols, int rows) @@ -1004,11 +1013,23 @@ xinit(int cols, int rows)
Window parent; Window parent;
pid_t thispid = getpid(); pid_t thispid = getpid();
XColor xmousefg, xmousebg; XColor xmousefg, xmousebg;
@ -101,8 +104,8 @@ diff -up a/x.c b/x.c
if (!(xw.dpy = XOpenDisplay(NULL))) if (!(xw.dpy = XOpenDisplay(NULL)))
die("can't open display\n"); die("can't open display\n");
xw.scr = XDefaultScreen(xw.dpy); xw.scr = XDefaultScreen(xw.dpy);
xw.vis = XDefaultVisual(xw.dpy, xw.scr); - xw.vis = XDefaultVisual(xw.dpy, xw.scr);
+
+ if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) { + if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) {
+ parent = XRootWindow(xw.dpy, xw.scr); + parent = XRootWindow(xw.dpy, xw.scr);
+ xw.depth = 32; + xw.depth = 32;
@ -113,11 +116,10 @@ diff -up a/x.c b/x.c
+ +
+ XMatchVisualInfo(xw.dpy, xw.scr, xw.depth, TrueColor, &vis); + XMatchVisualInfo(xw.dpy, xw.scr, xw.depth, TrueColor, &vis);
+ xw.vis = vis.visual; + xw.vis = vis.visual;
+
/* font */ /* font */
if (!FcInit()) if (!FcInit())
die("could not init fontconfig.\n"); @@ -1018,7 +1039,7 @@ xinit(int cols, int rows)
@@ -1031,7 +1053,7 @@ xinit(int cols, int rows)
xloadfonts(usedfont, 0); xloadfonts(usedfont, 0);
/* colors */ /* colors */
@ -126,7 +128,7 @@ diff -up a/x.c b/x.c
xloadcols(); xloadcols();
/* adjust fixed window geometry */ /* adjust fixed window geometry */
@@ -1051,19 +1073,15 @@ xinit(int cols, int rows) @@ -1038,19 +1059,15 @@ xinit(int cols, int rows)
| ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
xw.attrs.colormap = xw.cmap; xw.attrs.colormap = xw.cmap;
@ -149,7 +151,7 @@ diff -up a/x.c b/x.c
XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel); XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h); XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h);
@@ -1907,6 +1925,9 @@ main(int argc, char *argv[]) @@ -1894,6 +1911,9 @@ main(int argc, char *argv[])
case 'a': case 'a':
allowaltscreen = 0; allowaltscreen = 0;
break; break;

View File

@ -1,22 +0,0 @@
diff --git a/x.c b/x.c
index 0422421..e00d930 100644
--- a/x.c
+++ b/x.c
@@ -627,6 +627,8 @@ setsel(char *str, Time t)
XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t);
if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win)
selclear();
+
+ clipcopy(NULL);
}
void
@@ -644,7 +646,7 @@ brelease(XEvent *e)
}
if (e->xbutton.button == Button2)
- selpaste(NULL);
+ clippaste(NULL);
else if (e->xbutton.button == Button1)
mousesel(e, 1);
}

12
st-clipboard-0.8.3.diff Normal file
View File

@ -0,0 +1,12 @@
diff --git a/x.c b/x.c
index e5f1737..5cabd60 100644
--- a/x.c
+++ b/x.c
@@ -673,6 +673,7 @@ setsel(char *str, Time t)
XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t);
if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win)
selclear();
+ clipcopy(NULL);
}
void

View File

@ -1,8 +1,8 @@
diff --git a/config.def.h b/config.def.h diff --git a/config.def.h b/config.def.h
index 823e79f..f6278a3 100644 index 0895a1f..eef24df 100644
--- a/config.def.h --- a/config.def.h
+++ b/config.def.h +++ b/config.def.h
@@ -178,6 +178,8 @@ static Shortcut shortcuts[] = { @@ -188,6 +188,8 @@ static Shortcut shortcuts[] = {
{ TERMMOD, XK_Y, selpaste, {.i = 0} }, { TERMMOD, XK_Y, selpaste, {.i = 0} },
{ ShiftMask, XK_Insert, selpaste, {.i = 0} }, { ShiftMask, XK_Insert, selpaste, {.i = 0} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, { TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
@ -12,7 +12,7 @@ index 823e79f..f6278a3 100644
/* /*
diff --git a/st.c b/st.c diff --git a/st.c b/st.c
index b8e6077..218ae73 100644 index 0ce6ac2..641edc0 100644
--- a/st.c --- a/st.c
+++ b/st.c +++ b/st.c
@@ -35,6 +35,7 @@ @@ -35,6 +35,7 @@
@ -26,7 +26,7 @@ index b8e6077..218ae73 100644
@@ -42,6 +43,9 @@ @@ -42,6 +43,9 @@
#define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f)) #define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f))
#define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c)) #define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c))
#define ISDELIM(u) (utf8strchr(worddelimiters, u) != NULL) #define ISDELIM(u) (u && wcschr(worddelimiters, u))
+#define TLINE(y) ((y) < term.scr ? term.hist[((y) + term.histi - \ +#define TLINE(y) ((y) < term.scr ? term.hist[((y) + term.histi - \
+ term.scr + HISTSIZE + 1) % HISTSIZE] : \ + term.scr + HISTSIZE + 1) % HISTSIZE] : \
+ term.line[(y) - term.scr]) + term.line[(y) - term.scr])
@ -43,7 +43,7 @@ index b8e6077..218ae73 100644
int *dirty; /* dirtyness of lines */ int *dirty; /* dirtyness of lines */
TCursor c; /* cursor */ TCursor c; /* cursor */
int ocx; /* old cursor col */ int ocx; /* old cursor col */
@@ -184,8 +191,8 @@ static void tnewline(int); @@ -185,8 +192,8 @@ static void tnewline(int);
static void tputtab(int); static void tputtab(int);
static void tputc(Rune); static void tputc(Rune);
static void treset(void); static void treset(void);
@ -54,7 +54,7 @@ index b8e6077..218ae73 100644
static void tsetattr(int *, int); static void tsetattr(int *, int);
static void tsetchar(Rune, Glyph *, int, int); static void tsetchar(Rune, Glyph *, int, int);
static void tsetdirt(int, int); static void tsetdirt(int, int);
@@ -427,10 +434,10 @@ tlinelen(int y) @@ -415,10 +422,10 @@ tlinelen(int y)
{ {
int i = term.col; int i = term.col;
@ -67,7 +67,7 @@ index b8e6077..218ae73 100644
--i; --i;
return i; return i;
@@ -539,7 +546,7 @@ selsnap(int *x, int *y, int direction) @@ -527,7 +534,7 @@ selsnap(int *x, int *y, int direction)
* Snap around if the word wraps around at the end or * Snap around if the word wraps around at the end or
* beginning of a line. * beginning of a line.
*/ */
@ -76,7 +76,7 @@ index b8e6077..218ae73 100644
prevdelim = ISDELIM(prevgp->u); prevdelim = ISDELIM(prevgp->u);
for (;;) { for (;;) {
newx = *x + direction; newx = *x + direction;
@@ -554,14 +561,14 @@ selsnap(int *x, int *y, int direction) @@ -542,14 +549,14 @@ selsnap(int *x, int *y, int direction)
yt = *y, xt = *x; yt = *y, xt = *x;
else else
yt = newy, xt = newx; yt = newy, xt = newx;
@ -93,7 +93,7 @@ index b8e6077..218ae73 100644
delim = ISDELIM(gp->u); delim = ISDELIM(gp->u);
if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim
|| (delim && gp->u != prevgp->u))) || (delim && gp->u != prevgp->u)))
@@ -582,14 +589,14 @@ selsnap(int *x, int *y, int direction) @@ -570,14 +577,14 @@ selsnap(int *x, int *y, int direction)
*x = (direction < 0) ? 0 : term.col - 1; *x = (direction < 0) ? 0 : term.col - 1;
if (direction < 0) { if (direction < 0) {
for (; *y > 0; *y += direction) { for (; *y > 0; *y += direction) {
@ -110,7 +110,7 @@ index b8e6077..218ae73 100644
& ATTR_WRAP)) { & ATTR_WRAP)) {
break; break;
} }
@@ -620,13 +627,13 @@ getsel(void) @@ -608,13 +615,13 @@ getsel(void)
} }
if (sel.type == SEL_RECTANGULAR) { if (sel.type == SEL_RECTANGULAR) {
@ -192,7 +192,13 @@ index b8e6077..218ae73 100644
tsetdirt(orig, term.bot-n); tsetdirt(orig, term.bot-n);
tclearregion(0, term.bot-n+1, term.col-1, term.bot); tclearregion(0, term.bot-n+1, term.col-1, term.bot);
@@ -1080,13 +1130,23 @@ tscrolldown(int orig, int n) @@ -1076,17 +1126,28 @@ tscrolldown(int orig, int n)
term.line[i-n] = temp;
}
- selscroll(orig, n);
+ if (term.scr == 0)
+ selscroll(orig, n);
} }
void void
@ -217,7 +223,17 @@ index b8e6077..218ae73 100644
tclearregion(0, orig, term.col-1, orig+n-1); tclearregion(0, orig, term.col-1, orig+n-1);
tsetdirt(orig+n, term.bot); tsetdirt(orig+n, term.bot);
@@ -1135,7 +1195,7 @@ tnewline(int first_col) @@ -1096,7 +1157,8 @@ tscrollup(int orig, int n)
term.line[i+n] = temp;
}
- selscroll(orig, -n);
+ if (term.scr == 0)
+ selscroll(orig, -n);
}
void
@@ -1135,7 +1197,7 @@ tnewline(int first_col)
int y = term.c.y; int y = term.c.y;
if (y == term.bot) { if (y == term.bot) {
@ -226,7 +242,7 @@ index b8e6077..218ae73 100644
} else { } else {
y++; y++;
} }
@@ -1300,14 +1360,14 @@ void @@ -1300,14 +1362,14 @@ void
tinsertblankline(int n) tinsertblankline(int n)
{ {
if (BETWEEN(term.c.y, term.top, term.bot)) if (BETWEEN(term.c.y, term.top, term.bot))
@ -243,7 +259,7 @@ index b8e6077..218ae73 100644
} }
int32_t int32_t
@@ -1737,11 +1797,11 @@ csihandle(void) @@ -1738,11 +1800,11 @@ csihandle(void)
break; break;
case 'S': /* SU -- Scroll <n> line up */ case 'S': /* SU -- Scroll <n> line up */
DEFAULT(csiescseq.arg[0], 1); DEFAULT(csiescseq.arg[0], 1);
@ -257,7 +273,7 @@ index b8e6077..218ae73 100644
break; break;
case 'L': /* IL -- Insert <n> blank lines */ case 'L': /* IL -- Insert <n> blank lines */
DEFAULT(csiescseq.arg[0], 1); DEFAULT(csiescseq.arg[0], 1);
@@ -2243,7 +2303,7 @@ eschandle(uchar ascii) @@ -2248,7 +2310,7 @@ eschandle(uchar ascii)
return 0; return 0;
case 'D': /* IND -- Linefeed */ case 'D': /* IND -- Linefeed */
if (term.c.y == term.bot) { if (term.c.y == term.bot) {
@ -266,7 +282,7 @@ index b8e6077..218ae73 100644
} else { } else {
tmoveto(term.c.x, term.c.y+1); tmoveto(term.c.x, term.c.y+1);
} }
@@ -2256,7 +2316,7 @@ eschandle(uchar ascii) @@ -2261,7 +2323,7 @@ eschandle(uchar ascii)
break; break;
case 'M': /* RI -- Reverse index */ case 'M': /* RI -- Reverse index */
if (term.c.y == term.top) { if (term.c.y == term.top) {
@ -275,7 +291,7 @@ index b8e6077..218ae73 100644
} else { } else {
tmoveto(term.c.x, term.c.y-1); tmoveto(term.c.x, term.c.y-1);
} }
@@ -2475,7 +2535,7 @@ twrite(const char *buf, int buflen, int show_ctrl) @@ -2482,7 +2544,7 @@ twrite(const char *buf, int buflen, int show_ctrl)
void void
tresize(int col, int row) tresize(int col, int row)
{ {
@ -284,7 +300,7 @@ index b8e6077..218ae73 100644
int minrow = MIN(row, term.row); int minrow = MIN(row, term.row);
int mincol = MIN(col, term.col); int mincol = MIN(col, term.col);
int *bp; int *bp;
@@ -2512,6 +2572,14 @@ tresize(int col, int row) @@ -2519,6 +2581,14 @@ tresize(int col, int row)
term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty)); term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty));
term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs)); term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs));
@ -299,7 +315,7 @@ index b8e6077..218ae73 100644
/* resize each row to new width, zero-pad if needed */ /* resize each row to new width, zero-pad if needed */
for (i = 0; i < minrow; i++) { for (i = 0; i < minrow; i++) {
term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph)); term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph));
@@ -2569,7 +2637,7 @@ drawregion(int x1, int y1, int x2, int y2) @@ -2577,7 +2647,7 @@ drawregion(int x1, int y1, int x2, int y2)
continue; continue;
term.dirty[y] = 0; term.dirty[y] = 0;
@ -308,7 +324,7 @@ index b8e6077..218ae73 100644
} }
} }
@@ -2590,8 +2658,9 @@ draw(void) @@ -2598,8 +2668,9 @@ draw(void)
cx--; cx--;
drawregion(0, 0, term.col, term.row); drawregion(0, 0, term.col, term.row);
@ -317,14 +333,14 @@ index b8e6077..218ae73 100644
+ if (term.scr == 0) + if (term.scr == 0)
+ xdrawcursor(cx, term.c.y, term.line[term.c.y][cx], + xdrawcursor(cx, term.c.y, term.line[term.c.y][cx],
+ term.ocx, term.ocy, term.line[term.ocy][term.ocx]); + term.ocx, term.ocy, term.line[term.ocy][term.ocx]);
term.ocx = cx, term.ocy = term.c.y; term.ocx = cx;
term.ocy = term.c.y;
xfinishdraw(); xfinishdraw();
}
diff --git a/st.h b/st.h diff --git a/st.h b/st.h
index 38c61c4..17a79e0 100644 index d978458..b9a4eeb 100644
--- a/st.h --- a/st.h
+++ b/st.h +++ b/st.h
@@ -80,6 +80,8 @@ void die(const char *, ...); @@ -81,6 +81,8 @@ void die(const char *, ...);
void redraw(void); void redraw(void);
void draw(void); void draw(void);

View File

@ -1,71 +0,0 @@
diff --git a/config.def.h b/config.def.h
index 27d42ca..feec7e2 100644
--- a/config.def.h
+++ b/config.def.h
@@ -156,8 +156,14 @@ static unsigned int defaultattr = 11;
*/
static MouseShortcut mshortcuts[] = {
/* button mask string */
- { Button4, XK_ANY_MOD, "\031" },
- { Button5, XK_ANY_MOD, "\005" },
+ { Button4, XK_NO_MOD, "\031" },
+ { Button5, XK_NO_MOD, "\005" },
+};
+
+MouseKey mkeys[] = {
+ /* button mask function argument */
+ { Button4, ShiftMask, kscrollup, {.i = 1} },
+ { Button5, ShiftMask, kscrolldown, {.i = 1} },
};
/* Internal keyboard shortcuts. */
diff --git a/st.h b/st.h
index 628e876..cdd25ae 100644
--- a/st.h
+++ b/st.h
@@ -81,6 +81,13 @@ typedef union {
const void *v;
} Arg;
+typedef struct {
+ uint b;
+ uint mask;
+ void (*func)(const Arg *);
+ const Arg arg;
+} MouseKey;
+
void die(const char *, ...);
void redraw(void);
void draw(void);
@@ -129,3 +136,4 @@ extern char *termname;
extern unsigned int tabspaces;
extern unsigned int defaultfg;
extern unsigned int defaultbg;
+extern MouseKey mkeys[];
diff --git a/x.c b/x.c
index d43a529..754d859 100644
--- a/x.c
+++ b/x.c
@@ -409,6 +409,7 @@ bpress(XEvent *e)
{
struct timespec now;
MouseShortcut *ms;
+ MouseKey *mk;
int snap;
if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
@@ -424,6 +425,14 @@ bpress(XEvent *e)
}
}
+ for (mk = mkeys; mk < mkeys + LEN(mkeys); mk++) {
+ if (e->xbutton.button == mk->b
+ && match(mk->mask, e->xbutton.state)) {
+ mk->func(&mk->arg);
+ return;
+ }
+ }
+
if (e->xbutton.button == Button1) {
/*
* If the user clicks below predefined timeouts specific

View File

@ -0,0 +1,13 @@
diff --git a/config.def.h b/config.def.h
index ec1b576..4b3bf15 100644
--- a/config.def.h
+++ b/config.def.h
@@ -163,6 +163,8 @@ static uint forcemousemod = ShiftMask;
*/
static MouseShortcut mshortcuts[] = {
/* mask button function argument release */
+ { ShiftMask, Button4, kscrollup, {.i = 1} },
+ { ShiftMask, Button5, kscrolldown, {.i = 1} },
{ XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
{ XK_ANY_MOD, Button5, ttysend, {.s = "\005"} },

View File

@ -0,0 +1,63 @@
diff --git a/config.def.h b/config.def.h
index 4b3bf15..1986316 100644
--- a/config.def.h
+++ b/config.def.h
@@ -163,8 +163,8 @@ static uint forcemousemod = ShiftMask;
*/
static MouseShortcut mshortcuts[] = {
/* mask button function argument release */
- { ShiftMask, Button4, kscrollup, {.i = 1} },
- { ShiftMask, Button5, kscrolldown, {.i = 1} },
+ { XK_ANY_MOD, Button4, kscrollup, {.i = 1}, 0, /* !alt */ -1 },
+ { XK_ANY_MOD, Button5, kscrolldown, {.i = 1}, 0, /* !alt */ -1 },
{ XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
{ XK_ANY_MOD, Button5, ttysend, {.s = "\005"} },
diff --git a/st.c b/st.c
index f8b6f67..dd4cb31 100644
--- st.c
+++ st.c
@@ -1045,6 +1045,11 @@ tnew(int col, int row)
treset();
}
+int tisaltscr(void)
+{
+ return IS_SET(MODE_ALTSCREEN);
+}
+
void
tswapscreen(void)
{
diff --git a/st.h b/st.h
index 1332cf1..f9ad815 100644
--- st.h
+++ st.h
@@ -89,6 +89,7 @@ void sendbreak(const Arg *);
void toggleprinter(const Arg *);
int tattrset(int);
+int tisaltscr(void);
void tnew(int, int);
void tresize(int, int);
void tsetdirtattr(int);
diff --git a/x.c b/x.c
index e5f1737..b8fbd7b 100644
--- x.c
+++ x.c
@@ -34,6 +34,7 @@ typedef struct {
void (*func)(const Arg *);
const Arg arg;
uint release;
+ int altscrn; /* 0: don't care, -1: not alt screen, 1: alt screen */
} MouseShortcut;
typedef struct {
@@ -446,6 +447,7 @@ mouseaction(XEvent *e, uint release)
for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) {
if (ms->release == release &&
ms->button == e->xbutton.button &&
+ (!ms->altscrn || (ms->altscrn == (tisaltscr() ? 1 : -1))) &&
(match(ms->mod, state) || /* exact or forced */
match(ms->mod, state & ~forcemousemod))) {
ms->func(&(ms->arg));