fix(terminal): forward horizontal mouse scrolling

This commit is contained in:
zeertzjq
2023-08-04 10:24:27 +08:00
parent 241d649c23
commit 060886e16c
3 changed files with 218 additions and 65 deletions

View File

@@ -576,6 +576,8 @@ static int terminal_execute(VimState *state, int key)
case K_RIGHTRELEASE:
case K_MOUSEDOWN:
case K_MOUSEUP:
case K_MOUSELEFT:
case K_MOUSERIGHT:
if (send_mouse_event(s->term, key)) {
return 0;
}
@@ -1439,6 +1441,10 @@ static bool send_mouse_event(Terminal *term, int c)
pressed = true; button = 4; break;
case K_MOUSEUP:
pressed = true; button = 5; break;
case K_MOUSELEFT:
pressed = true; button = 7; break;
case K_MOUSERIGHT:
pressed = true; button = 6; break;
default:
return false;
}