[RFE weston] Support the new wheel tilt axis source
Peter Hutterer
peter.hutterer at who-t.net
Tue Dec 6 04:37:38 UTC 2016
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
Also just an RFE, it's missing the various version requirements (libinput
doesn't have a tag for this yet). Not much we can do in weston but treat it
effectively the same as the wheel rotation.
clients/eventdemo.c | 3 +++
libweston/libinput-device.c | 7 ++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/clients/eventdemo.c b/clients/eventdemo.c
index d8eef5b..faa2621 100644
--- a/clients/eventdemo.c
+++ b/clients/eventdemo.c
@@ -304,6 +304,9 @@ axis_source_handler(struct widget *widget, struct input *input,
case WL_POINTER_AXIS_SOURCE_CONTINUOUS:
axis_source = "continuous";
break;
+ case WL_POINTER_AXIS_SOURCE_WHEEL_TILT:
+ axis_source = "wheel-tilt";
+ break;
default:
axis_source = "<invalid source value>";
break;
diff --git a/libweston/libinput-device.c b/libweston/libinput-device.c
index f97afcf..55b96f3 100644
--- a/libweston/libinput-device.c
+++ b/libweston/libinput-device.c
@@ -182,6 +182,7 @@ normalize_scroll(struct libinput_event_pointer *pointer_event,
*/
switch (source) {
case LIBINPUT_POINTER_AXIS_SOURCE_WHEEL:
+ case LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT:
value = 10 * libinput_event_pointer_get_axis_value_discrete(
pointer_event,
axis);
@@ -204,7 +205,8 @@ get_axis_discrete(struct libinput_event_pointer *pointer_event,
source = libinput_event_pointer_get_axis_source(pointer_event);
- if (source != LIBINPUT_POINTER_AXIS_SOURCE_WHEEL)
+ if (source != LIBINPUT_POINTER_AXIS_SOURCE_WHEEL &&
+ source != LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT)
return 0;
return libinput_event_pointer_get_axis_value_discrete(pointer_event,
@@ -245,6 +247,9 @@ handle_pointer_axis(struct libinput_device *libinput_device,
case LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS:
wl_axis_source = WL_POINTER_AXIS_SOURCE_CONTINUOUS;
break;
+ case LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT:
+ wl_axis_source = WL_POINTER_AXIS_SOURCE_WHEEL_TILT;
+ break;
default:
if (warned < 5) {
weston_log("Unknown scroll source %d.\n", source);
--
2.9.3
More information about the wayland-devel
mailing list