From bda4877b5f5fb0aaa7cb9d5e5d9fddb9465aa255 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Wed, 20 May 2020 14:39:35 +0200 Subject: [PATCH] Make shift+wheel behaves as shift+Prev/Next St uses a very good hack where mouse wheel genereates ^Y and ^E, that are the same keys that less and vi uses for backward and fordward scrolling. Scroll, as many terminal emulators, use shift+Prev/Next for scrolling, but it is also using ^E and ^Y for scroling, characters that are reserved in the POSIX shell in emacs mode for end of line and yanking, making scroll unsable in st. This patch adds a new hack, making shift+wheel returning the same sequences than shift+Prev/Next, meaning that scroll or any other similar program will not be able to differentiate between them. --- README.md | 4 ++-- config.def.h | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 54a1bd6..fca62e0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Similar to [dwm-flexipatch](https://github.com/bakkeby/dwm-flexipatch) this st 0.8.3 (d66111, 2020-05-09) project has a different take on st patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more. +Similar to [dwm-flexipatch](https://github.com/bakkeby/dwm-flexipatch) this st 0.8.3 (b889b2, 2020-05-16) project has a different take on st patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more. For example to include the `alpha` patch then you would only need to flip this setting from 0 to 1 in [patches.h](https://github.com/bakkeby/st-flexipatch/blob/master/patches.def.h): ```c @@ -15,7 +15,7 @@ Refer to [https://st.suckless.org/](https://st.suckless.org/) for details on the ### Changelog: -2020-05-20 - Upgrade to d66111, 2020-05-09, removed visualbell 1, 2, 3 patches and force redraw after keypress due to incompatibility +2020-05-20 - Upgrade to b889b2, 2020-05-09, removed visualbell 1, 2, 3 patches and force redraw after keypress due to incompatibility 2020-04-20 - Upgrade to c279f5, 2020-04-19, and added the force redraw on pselect after key is pressed patch and the externalpipein patch diff --git a/config.def.h b/config.def.h index f4542ec..45f1643 100644 --- a/config.def.h +++ b/config.def.h @@ -263,6 +263,9 @@ static MouseShortcut mshortcuts[] = { #if SCROLLBACK_MOUSE_PATCH { ShiftMask, Button4, kscrollup, {.i = 1} }, { ShiftMask, Button5, kscrolldown, {.i = 1} }, + #else + { ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} }, + { ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} }, #endif // SCROLLBACK_MOUSE_PATCH #if SCROLLBACK_MOUSE_ALTSCREEN_PATCH { XK_NO_MOD, Button4, kscrollup, {.i = 1} }, @@ -271,7 +274,6 @@ static MouseShortcut mshortcuts[] = { { XK_ANY_MOD, Button4, ttysend, {.s = "\031"} }, { XK_ANY_MOD, Button5, ttysend, {.s = "\005"} }, #endif // SCROLLBACK_MOUSE_ALTSCREEN_PATCH - }; #if SCROLLBACK_MOUSE_ALTSCREEN_PATCH