From ef400b26ab180b0dd7a7cf8f306d2ac72fcfe40a Mon Sep 17 00:00:00 2001 From: Harry Cutts Date: Fri, 16 Dec 2022 21:26:24 +0000 Subject: Report two-finger touchpad swipes Bug: 251196347 Test: try out two-finger scroll gestures with an Apple Magic Trackpad 2 Test: atest inputflinger_tests Change-Id: I9e693350873b90bd50605ab348821224ae1121a8 --- include/android/input.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'include/android/input.h') diff --git a/include/android/input.h b/include/android/input.h index a0b46de260..e1aac65457 100644 --- a/include/android/input.h +++ b/include/android/input.h @@ -786,6 +786,19 @@ enum { * The same as {@link AMOTION_EVENT_AXIS_GESTURE_X_OFFSET}, but for the Y axis. */ AMOTION_EVENT_AXIS_GESTURE_Y_OFFSET = 49, + /** + * Axis constant: X scroll distance axis of a motion event. + * + * - For a touch pad, reports the distance that should be scrolled in the X axis as a result of + * the user's two-finger scroll gesture, in display pixels. + */ + AMOTION_EVENT_AXIS_GESTURE_SCROLL_X_DISTANCE = 50, + /** + * Axis constant: Y scroll distance axis of a motion event. + * + * The same as {@link AMOTION_EVENT_AXIS_GESTURE_SCROLL_X_DISTANCE}, but for the Y axis. + */ + AMOTION_EVENT_AXIS_GESTURE_SCROLL_Y_DISTANCE = 51, /** * Note: This is not an "Axis constant". It does not represent any axis, nor should it be used @@ -793,7 +806,7 @@ enum { * to make some computations (like iterating through all possible axes) cleaner. * Please update the value accordingly if you add a new axis. */ - AMOTION_EVENT_MAXIMUM_VALID_AXIS_VALUE = AMOTION_EVENT_AXIS_GESTURE_Y_OFFSET, + AMOTION_EVENT_MAXIMUM_VALID_AXIS_VALUE = AMOTION_EVENT_AXIS_GESTURE_SCROLL_Y_DISTANCE, // NOTE: If you add a new axis here you must also add it to several other files. // Refer to frameworks/base/core/java/android/view/MotionEvent.java for the full list. -- cgit v1.2.3-59-g8ed1b