summaryrefslogtreecommitdiff
path: root/include/android/input.h
diff options
context:
space:
mode:
author Harry Cutts <hcutts@google.com> 2022-12-20 11:02:26 +0000
committer Harry Cutts <hcutts@google.com> 2023-01-09 15:03:30 +0000
commitb1e8355b5967159230b80b207396230c671f6280 (patch)
tree1e2b1e2588aadcad833972ecce1acfb9e27c099b /include/android/input.h
parentef400b26ab180b0dd7a7cf8f306d2ac72fcfe40a (diff)
Report pinch gestures
Bug: 251196347 Test: check events received by a custom tester app, and touches shown by pointer location overlay Test: atest inputflinger_tests Change-Id: I249ca6208091e3c4291c5be68c77339bf5f69a5b
Diffstat (limited to 'include/android/input.h')
-rw-r--r--include/android/input.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/include/android/input.h b/include/android/input.h
index e1aac65457..d6f9d633b6 100644
--- a/include/android/input.h
+++ b/include/android/input.h
@@ -778,6 +778,9 @@ enum {
* proportion of the touch pad's size. For example, if a touch pad is 1000 units wide, and a
* swipe gesture starts at X = 500 then moves to X = 400, this axis would have a value of
* -0.1.
+ *
+ * These values are relative to the state from the last event, not accumulated, so developers
+ * should make sure to process this axis value for all batched historical events.
*/
AMOTION_EVENT_AXIS_GESTURE_X_OFFSET = 48,
/**
@@ -791,6 +794,9 @@ enum {
*
* - 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.
+ *
+ * These values are relative to the state from the last event, not accumulated, so developers
+ * should make sure to process this axis value for all batched historical events.
*/
AMOTION_EVENT_AXIS_GESTURE_SCROLL_X_DISTANCE = 50,
/**
@@ -799,6 +805,18 @@ enum {
* The same as {@link AMOTION_EVENT_AXIS_GESTURE_SCROLL_X_DISTANCE}, but for the Y axis.
*/
AMOTION_EVENT_AXIS_GESTURE_SCROLL_Y_DISTANCE = 51,
+ /**
+ * Axis constant: pinch scale factor of a motion event.
+ *
+ * - For a touch pad, reports the change in distance between the fingers when the user is making
+ * a pinch gesture, as a proportion of that distance when the gesture was last reported. For
+ * example, if the fingers were 50 units apart and are now 52 units apart, the scale factor
+ * would be 1.04.
+ *
+ * These values are relative to the state from the last event, not accumulated, so developers
+ * should make sure to process this axis value for all batched historical events.
+ */
+ AMOTION_EVENT_AXIS_GESTURE_PINCH_SCALE_FACTOR = 52,
/**
* Note: This is not an "Axis constant". It does not represent any axis, nor should it be used
@@ -806,7 +824,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_SCROLL_Y_DISTANCE,
+ AMOTION_EVENT_MAXIMUM_VALID_AXIS_VALUE = AMOTION_EVENT_AXIS_GESTURE_PINCH_SCALE_FACTOR,
// 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.
@@ -891,6 +909,13 @@ enum AMotionClassification : uint32_t {
* why they have a separate constant from two-finger swipes.
*/
AMOTION_EVENT_CLASSIFICATION_MULTI_FINGER_SWIPE = 4,
+ /**
+ * Classification constant: pinch.
+ *
+ * The current event stream represents the user pinching with two fingers on a touchpad. The
+ * gesture is centered around the current cursor position.
+ */
+ AMOTION_EVENT_CLASSIFICATION_PINCH = 5,
};
/**