diff options
| author | Malfurious <m@lfurio.us> | 2021-10-03 01:42:26 -0400 |
|---|---|---|
| committer | Matt Hunter <m@lfurio.us> | 2026-01-17 20:00:23 -0500 |
| commit | 91f6d03e84949289138000baaa63b1fbd1030f20 (patch) | |
| tree | d787e69965c32fb47c0eae2b4b6bc61f1f41488d | |
| parent | 57e6bfbd12721471c4da0f41a158441052e7a527 (diff) | |
| download | st-91f6d03e84949289138000baaa63b1fbd1030f20.tar.gz st-91f6d03e84949289138000baaa63b1fbd1030f20.zip | |
patch: scrollback-mouse-increment (custom rewrite)
Apply the following patch on top of the first two to allow changing how
fast the mouse scrolls.
I had to manually reimplement this patch myself, since the version from
suckless.org doesn't apply cleanly on top of the first three when
starting from commit bda9c9ffa645.
In addition to fixing-up this patch so it applies to the previous HEAD,
a comment is added stating that the codes sent while scrolling in
alt-screen mode (the btn 4/5 fallbacks) need to be maintained along with
the preferred mousescrollincrement setting so the two modes scroll the
same, which they currently do.
| -rw-r--r-- | config.def.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/config.def.h b/config.def.h index b0109bc..595ca3d 100644 --- a/config.def.h +++ b/config.def.h @@ -177,14 +177,15 @@ static uint forcemousemod = ShiftMask; * Internal mouse shortcuts. * Beware that overloading Button1 will disable the selection. */ +const unsigned int mousescrollincrement = 1; static MouseShortcut mshortcuts[] = { /* mask button function argument release */ - { XK_ANY_MOD, Button4, kscrollup, {.i = 1}, 0, /* !alt */ -1 }, - { XK_ANY_MOD, Button5, kscrolldown, {.i = 1}, 0, /* !alt */ -1 }, + { XK_ANY_MOD, Button4, kscrollup, {.i = mousescrollincrement}, 0, /* !alt */ -1 }, + { XK_ANY_MOD, Button5, kscrolldown, {.i = mousescrollincrement}, 0, /* !alt */ -1 }, { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 }, - { ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} }, + + /* Be sure to modify Button4/5 codes whenever mousescrollincrement is updated! */ { XK_ANY_MOD, Button4, ttysend, {.s = "\031"} }, - { ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} }, { XK_ANY_MOD, Button5, ttysend, {.s = "\005"} }, }; |
