mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-26 01:40:12 -05:00
scrollback: initial support for mouse scrolling
This commit is contained in:
parent
bcd111d203
commit
b058e6384a
3 changed files with 41 additions and 13 deletions
16
input.c
16
input.c
|
|
@ -143,12 +143,12 @@ keyboard_key(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial,
|
|||
|
||||
if (effective_mods == shift) {
|
||||
if (sym == XKB_KEY_Page_Up) {
|
||||
cmd_scrollback_up(term);
|
||||
cmd_scrollback_up(term, term->rows);
|
||||
found_map = true;
|
||||
}
|
||||
|
||||
else if (sym == XKB_KEY_Page_Down) {
|
||||
cmd_scrollback_down(term);
|
||||
cmd_scrollback_down(term, term->rows);
|
||||
found_map = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -342,6 +342,18 @@ static void
|
|||
wl_pointer_axis(void *data, struct wl_pointer *wl_pointer,
|
||||
uint32_t time, uint32_t axis, wl_fixed_t value)
|
||||
{
|
||||
struct terminal *term = data;
|
||||
|
||||
/* TODO: generate button event for BTN_FORWARD/BTN_BACK? */
|
||||
|
||||
if (axis != WL_POINTER_AXIS_VERTICAL_SCROLL)
|
||||
return;
|
||||
|
||||
int amount = wl_fixed_to_int(value);
|
||||
if (amount < 0)
|
||||
cmd_scrollback_up(term, -amount);
|
||||
else
|
||||
cmd_scrollback_down(term, amount);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue