aboutsummaryrefslogtreecommitdiff
path: root/input.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-08-07 10:28:17 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-08-07 10:28:17 +0000
commit496f5056483ff888b6116d7895cda3c1e2a359fc (patch)
tree7d9c713d8247344f4f0880933573cc74b4dd275b /input.h
parentRevert "terminfo: add ich1=\E[@" (diff)
parentinput: implement support for mouse wheel left/right (diff)
Merge branch 'mouse-wheel-tilt'
Diffstat (limited to 'input.h')
-rw-r--r--input.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/input.h b/input.h
index 1ecc9e28..68b8719d 100644
--- a/input.h
+++ b/input.h
@@ -5,6 +5,23 @@
#include "wayland.h"
+/*
+ * Custom defines for mouse wheel left/right buttons.
+ *
+ * Libinput does not define these. On Wayland, all scroll events (both
+ * vertical and horizontal) are reported not as buttons, as ‘axis’
+ * events.
+ *
+ * Libinput _does_ define BTN_BACK and BTN_FORWARD, which is
+ * what we use for vertical scroll events. But for horizontal scroll
+ * events, there aren’t any pre-defined mouse buttons.
+ *
+ * Mouse buttons are in the range 0x110 - 0x11f, with joystick defines
+ * starting at 0x120.
+ */
+#define BTN_WHEEL_LEFT 0x11e
+#define BTN_WHEEL_RIGHT 0x11f
+
extern const struct wl_keyboard_listener keyboard_listener;
extern const struct wl_pointer_listener pointer_listener;