Add AXIS_GESTURE_SCROLL_{X,Y}_DISTANCE MotionEvent axes

Bug: 251196347
Test: try out two-finger scroll gestures with an Apple Magic Trackpad 2
Test: atest inputflinger_tests
Change-Id: Ib9135dc0b782f300b074b05b32383715845f94ba
This commit is contained in:
Harry Cutts
2022-12-16 17:33:45 +00:00
parent 6356f9dee8
commit e4df12d234
2 changed files with 21 additions and 0 deletions

View File

@@ -50482,6 +50482,8 @@ package android.view {
field public static final int AXIS_GENERIC_7 = 38; // 0x26
field public static final int AXIS_GENERIC_8 = 39; // 0x27
field public static final int AXIS_GENERIC_9 = 40; // 0x28
field public static final int AXIS_GESTURE_SCROLL_X_DISTANCE = 50; // 0x32
field public static final int AXIS_GESTURE_SCROLL_Y_DISTANCE = 51; // 0x33
field public static final int AXIS_GESTURE_X_OFFSET = 48; // 0x30
field public static final int AXIS_GESTURE_Y_OFFSET = 49; // 0x31
field public static final int AXIS_HAT_X = 15; // 0xf

View File

@@ -1293,6 +1293,23 @@ public final class MotionEvent extends InputEvent implements Parcelable {
*/
public static final int AXIS_GESTURE_Y_OFFSET = 49;
/**
* Axis constant: X scroll distance axis of a motion event.
* <p>
* <ul>
* <li>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.
* </ul>
*/
public static final int AXIS_GESTURE_SCROLL_X_DISTANCE = 50;
/**
* Axis constant: Y scroll distance axis of a motion event.
*
* The same as {@link #AXIS_GESTURE_SCROLL_X_DISTANCE}, but for the Y axis.
*/
public static final int AXIS_GESTURE_SCROLL_Y_DISTANCE = 51;
// NOTE: If you add a new axis here you must also add it to:
// frameworks/native/include/android/input.h
// frameworks/native/libs/input/InputEventLabels.cpp
@@ -1350,6 +1367,8 @@ public final class MotionEvent extends InputEvent implements Parcelable {
names.append(AXIS_GENERIC_16, "AXIS_GENERIC_16");
names.append(AXIS_GESTURE_X_OFFSET, "AXIS_GESTURE_X_OFFSET");
names.append(AXIS_GESTURE_Y_OFFSET, "AXIS_GESTURE_Y_OFFSET");
names.append(AXIS_GESTURE_SCROLL_X_DISTANCE, "AXIS_GESTURE_SCROLL_X_DISTANCE");
names.append(AXIS_GESTURE_SCROLL_Y_DISTANCE, "AXIS_GESTURE_SCROLL_Y_DISTANCE");
}
/**