input: implement support for mouse wheel left/right

We now emit button 6/7 events (when the client application grabs the
mouse). This buttons map to mouse wheel horizontal scroll events. Or, left/right
tilting, if you like.

Wayland report these as ‘axis’ events (just like regular scroll wheel events),
and thus we need to translate those scroll events to button events.

libinput does not define any mouse buttons for wheel tilts, so we add our own
defitions. These are added last in the BTN_* range, just before the BTN_JOYSTICK
events.
This commit is contained in:
Daniel Eklöf 2021-08-05 18:34:09 +02:00
parent 7a372a8c23
commit c2cc964116
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 55 additions and 29 deletions

View file

@ -41,6 +41,7 @@
of box drawing characters rendered by foot itself (rather than using
font glyphs) (https://codeberg.org/dnkl/foot/issues/474).
* `XM`+`xm` to terminfo.
* Mouse buttons 6/7 (mouse wheel left/right).
### Changed