[PATCH libinput 4/5] evdev: if a keyboard has a scroll wheel, allow natural scrolling

Peter Hutterer peter.hutterer at who-t.net
Tue Apr 7 16:54:32 PDT 2015


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/evdev.c b/src/evdev.c
index 16ebb9c..a394afa 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1679,6 +1679,11 @@ evdev_configure_device(struct evdev_device *device)
 		log_info(libinput,
 			 "input device '%s', %s is a keyboard\n",
 			 device->devname, devnode);
+
+		/* want natural-scroll config option */
+		if (libevdev_has_event_code(evdev, EV_REL, REL_WHEEL) ||
+		    libevdev_has_event_code(evdev, EV_REL, REL_HWHEEL))
+			device->scroll.natural_scrolling_enabled = true;
 	}
 
 	if (udev_tags & EVDEV_UDEV_TAG_TOUCHSCREEN) {
-- 
2.3.4



More information about the wayland-devel mailing list