summaryrefslogtreecommitdiff
path: root/clutter
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2017-06-12 15:25:10 -0700
committerCarlos Garnacho <carlosg@gnome.org>2017-07-17 21:22:15 +0200
commit4d8cb5408b439ae5260faa53c670e1fc531bd302 (patch)
treea5a3dd108aa03db1b4915ec7da16ae8604ff516d /clutter
parentf852d2b0eb98cdd6497a627bcf48f9f9db944d0b (diff)
downloadmutter-4d8cb5408b439ae5260faa53c670e1fc531bd302.tar.gz
wayland: Provide basic tablet wheel event support
Adds basic support for the "wheel" event from the Wayland tablet protocol. Ideally we would accumulate the angle and report a wheel event with an appropriate value for "clicks". We can get away with a much cruder method for the time being, however, since no Wacom tablet puck actually provides a smooth scrollwheel. Checking whether the angle in CLUTTER_INPUT_AXIS_WHEEL exceeds a nominally-small threshold is sufficient to determine that the wheel has advanced by at least one physical click. https://bugzilla.gnome.org/show_bug.cgi?id=783716
Diffstat (limited to 'clutter')
-rw-r--r--clutter/clutter/evdev/clutter-input-device-evdev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/clutter/clutter/evdev/clutter-input-device-evdev.c b/clutter/clutter/evdev/clutter-input-device-evdev.c
index 6019d05b4..cb4340a8f 100644
--- a/clutter/clutter/evdev/clutter-input-device-evdev.c
+++ b/clutter/clutter/evdev/clutter-input-device-evdev.c
@@ -163,6 +163,9 @@ clutter_input_device_evdev_update_from_tool (ClutterInputDevice *device,
if (libinput_tablet_tool_has_slider (evdev_tool->tool))
_clutter_input_device_add_axis (device, CLUTTER_INPUT_AXIS_SLIDER, -1, 1, 0);
+ if (libinput_tablet_tool_has_wheel (evdev_tool->tool))
+ _clutter_input_device_add_axis (device, CLUTTER_INPUT_AXIS_WHEEL, -180, 180, 0);
+
g_object_thaw_notify (G_OBJECT (device));
}