Patch scrolls back to sleepless ST terminal to support mouse wheel
The terminal has a scroll back patch , I want to update the mentioned patch to include mouse up and down signals in addition to "PageUp" and "PageDown". I suspect a small change in config.h
is what is needed, but I have no experience with terminal code, so my request for help.
The config.h
following lines appear in the source code :
static Mousekey mshortcuts[] = {
/* button mask string */
{ Button4, XK_ANY_MOD, "\031" },
{ Button5, XK_ANY_MOD, "\005" },
};
So, it is clear that we know what Button4 / 5 is. In addition, we have the following:
static Shortcut shortcuts[] = {
/* mask keysym function argument */
[...]
{ ShiftMask, XK_Page_Up, kscrollup, {.i = -1} },
{ ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} },
};
So, naively, I guess adding two more raw ones (one for the wheel up, one for the wheel down) will do the trick. However, what?
Note: I know that suckless recommends using a terminal muxer like tmux . I have been using this already. However, sometimes (rarely) I just want to use the terminal without tmux and this feature would be useful. Please do not comment / reply to using tmux , this is not the question in question.
source to share
It is not so easy. This question sometimes comes up when someone wants to scroll left / right for a mouse trackball.
There is an X event in the left column of the tables. They are limited to combinations of predefined characters.
Button4 and Button5 are mentioned because they are commonly used to dispatch mouse wheel events. This has been the case for quite some time; before the change to xterm in 1999, a resource file ( patch # 120 ) was used to make this a built-in function.
Possible X events are laid out in header files C - Xh - and tables in the X source code; no mouse events are provided per se. For example, the X Toolkit library has a table that lists all of the features (for clients using the X Toolkit, such as xterm). xev
uses header definitions.
If X supports mouse mouse events differently, new function calls are likely to be used for this purpose, since the existing information can be packed into bit-fields in such a way that it is not easily extensible.
source to share
The suckless site has some scrolling back patches that allow for scrolling with Shift+MouseWheel
as well as full mouse scrolling. The latest patch may break other mkeys
excluding scroll functions.
source to share