diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-07-10 12:17:44 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-07-10 12:17:44 +0000 |
| commit | 7594edb89bef777b02177b7c82f7231fac4e2528 (patch) | |
| tree | 4fe095ae914013ed3e15bbff1c4d3982e298f96d /input.c | |
| parent | main: hopefully fix logical error in delayed rendering (diff) | |
input: generate BTN_BACK/BTN_FORWARD mouse down events when scrolling
Diffstat (limited to 'input.c')
| -rw-r--r-- | input.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -7,6 +7,8 @@ #include <locale.h> #include <sys/mman.h> +#include <linux/input-event-codes.h> + #include <xkbcommon/xkbcommon.h> #include <xkbcommon/xkbcommon-keysyms.h> #include <xkbcommon/xkbcommon-compose.h> @@ -350,10 +352,20 @@ wl_pointer_axis(void *data, struct wl_pointer *wl_pointer, return; int amount = wl_fixed_to_int(value); - if (amount < 0) + + if (amount < 0) { + for (int i = 0; i < -amount; i++) { + term_mouse_down(term, BTN_BACK, term->mouse.row, term->mouse.col, + term->kbd.shift, term->kbd.alt, term->kbd.ctrl); + } cmd_scrollback_up(term, -amount); - else + } else { + for (int i = 0; i < amount; i++) { + term_mouse_down(term, BTN_FORWARD, term->mouse.row, term->mouse.col, + term->kbd.shift, term->kbd.alt, term->kbd.ctrl); + } cmd_scrollback_down(term, amount); + } } static void |
