[PATCH libinput 2/4] Add wheel tilt as axis source

Peter Hutterer peter.hutterer at who-t.net
Tue Nov 29 02:28:23 UTC 2016


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/libinput.h      | 15 +++++++++++++++
 tools/event-debug.c |  3 +++
 2 files changed, 18 insertions(+)

diff --git a/src/libinput.h b/src/libinput.h
index 18a96bd..aac93fc 100644
--- a/src/libinput.h
+++ b/src/libinput.h
@@ -259,6 +259,12 @@ enum libinput_pointer_axis_source {
 	 * The event is caused by the motion of some device.
 	 */
 	LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS,
+	/**
+	 * The event is caused by the tilting of a mouse wheel rather than
+	 * its rotation. This method is commonly used on mice without
+	 * separate horizontal scroll wheels.
+	 */
+	LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT,
 };
 
 /**
@@ -1285,6 +1291,15 @@ libinput_event_pointer_get_axis_value(struct libinput_event_pointer *event,
  * The coordinate system is identical to the cursor movement, i.e. a
  * scroll value of 1 represents the equivalent relative motion of 1.
  *
+ * If the source is @ref LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT, no
+ * terminating event is guaranteed (though it may happen).
+ * Scrolling is in discrete steps and there is no physical equivalent for
+ * the value returned here. For backwards compatibility, the value returned
+ * by this function is identical to a single mouse wheel rotation by this
+ * device (see the documentation for @ref LIBINPUT_POINTER_AXIS_SOURCE_WHEEL
+ * above). Callers should not use this value but instead exclusively refer
+ * to the value returned by libinput_event_pointer_get_axis_value_discrete().
+ *
  * For pointer events that are not of type @ref LIBINPUT_EVENT_POINTER_AXIS,
  * this function returns 0.
  *
diff --git a/tools/event-debug.c b/tools/event-debug.c
index 3e038be..5e9f671 100644
--- a/tools/event-debug.c
+++ b/tools/event-debug.c
@@ -377,6 +377,9 @@ print_pointer_axis_event(struct libinput_event *ev)
 	case LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS:
 		source = "continuous";
 		break;
+	case LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT:
+		source = "tilt";
+		break;
 	}
 
 	if (libinput_event_pointer_has_axis(p,
-- 
2.9.3



More information about the wayland-devel mailing list