mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
Work out mouse scroll wheel effect when the mouse is first detected and
store it in struct mouse_event, reduce the scroll size the 3 but allow shift to reduce it to 1 and meta and ctrl to multiply by 3 if the terminal supports them, also support wheel in choose mode. From Marcel Partap.
This commit is contained in:
@ -749,6 +749,15 @@ tty_keys_mouse(struct tty *tty, const char *buf, size_t len, size_t *size)
|
||||
m->x = x;
|
||||
m->y = y;
|
||||
if (b & MOUSE_MASK_WHEEL) {
|
||||
if (b & MOUSE_MASK_SHIFT)
|
||||
m->scroll = 1;
|
||||
else
|
||||
m->scroll = 3;
|
||||
if (b & MOUSE_MASK_META)
|
||||
m->scroll *= 3;
|
||||
if (b & MOUSE_MASK_CTRL)
|
||||
m->scroll *= 3;
|
||||
|
||||
b &= MOUSE_MASK_BUTTONS;
|
||||
if (b == 0)
|
||||
m->wheel = MOUSE_WHEEL_UP;
|
||||
|
Reference in New Issue
Block a user