diff options
| author | Jun Mukai <mukai@google.com> | 2015-12-03 01:13:31 -0800 |
|---|---|---|
| committer | Jun Mukai <mukai@google.com> | 2015-12-18 10:22:43 -0800 |
| commit | 347e5d498f4c216d588e98776a386d8bdf93d05c (patch) | |
| tree | 8f9b85983dcee4deeefc7fcbaa64124b6ea176f8 /core/java/android/view/MotionEvent.java | |
| parent | 92e432c30e2304272c2f5b1b33366f32c3d763cf (diff) | |
Introduce pointer capture API.
This depends on I4189eb4d93f50c2865b7a325727be5ceebcc71f8 of
frameworks/native.
Bug: 5452473
Change-Id: Ie21e521f3e5c581f976dc0feb5d84bfa48b046cd
Diffstat (limited to 'core/java/android/view/MotionEvent.java')
| -rw-r--r-- | core/java/android/view/MotionEvent.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/core/java/android/view/MotionEvent.java b/core/java/android/view/MotionEvent.java index 0195decfcf16..7a544b8f0bb3 100644 --- a/core/java/android/view/MotionEvent.java +++ b/core/java/android/view/MotionEvent.java @@ -977,6 +977,37 @@ public final class MotionEvent extends InputEvent implements Parcelable { public static final int AXIS_SCROLL = 26; /** + * Axis constant: The movement of x position of a motion event. + * <p> + * <ul> + * <li>For a mouse, reports a difference of x position between the previous position. + * This is useful when pointer is captured, in that case the mouse pointer doesn't change + * the location but this axis reports the difference which allows the app to see + * how the mouse is moved. + * </ul> + * </p> + * + * @see #getAxisValue(int, int) + * @see #getHistoricalAxisValue(int, int, int) + * @see MotionEvent.PointerCoords#getAxisValue(int, int) + * @see InputDevice#getMotionRange + */ + public static final int AXIS_RELATIVE_X = 27; + + /** + * Axis constant: The movement of y position of a motion event. + * <p> + * This is similar to {@link #AXIS_RELATIVE_X} but for y-axis. + * </p> + * + * @see #getAxisValue(int, int) + * @see #getHistoricalAxisValue(int, int, int) + * @see MotionEvent.PointerCoords#getAxisValue(int, int) + * @see InputDevice#getMotionRange + */ + public static final int AXIS_RELATIVE_Y = 28; + + /** * Axis constant: Generic 1 axis of a motion event. * The interpretation of a generic axis is device-specific. * @@ -1187,6 +1218,8 @@ public final class MotionEvent extends InputEvent implements Parcelable { names.append(AXIS_DISTANCE, "AXIS_DISTANCE"); names.append(AXIS_TILT, "AXIS_TILT"); names.append(AXIS_SCROLL, "AXIS_SCROLL"); + names.append(AXIS_RELATIVE_X, "AXIS_REALTIVE_X"); + names.append(AXIS_RELATIVE_Y, "AXIS_REALTIVE_Y"); names.append(AXIS_GENERIC_1, "AXIS_GENERIC_1"); names.append(AXIS_GENERIC_2, "AXIS_GENERIC_2"); names.append(AXIS_GENERIC_3, "AXIS_GENERIC_3"); |
