diff options
author | Michael Wright <michaelwr@google.com> | 2015-06-24 16:12:17 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-24 16:12:22 +0000 |
commit | 5edd0e06d5f75cb862f52cb65aa423c951eb2882 (patch) | |
tree | f36728dce90c45a155ce4d038fc61dcf8002df1d /core/java/android/view | |
parent | 838a29a659c2b7ee244140ea4042d90d48181145 (diff) | |
parent | f18920ba3182087938e245fab8e3e3008a39606b (diff) | |
download | frameworks_base-5edd0e06d5f75cb862f52cb65aa423c951eb2882.zip frameworks_base-5edd0e06d5f75cb862f52cb65aa423c951eb2882.tar.gz frameworks_base-5edd0e06d5f75cb862f52cb65aa423c951eb2882.tar.bz2 |
Merge "Add new SOURCE_BLUETOOTH_STYLUS." into mnc-dev
Diffstat (limited to 'core/java/android/view')
-rw-r--r-- | core/java/android/view/InputDevice.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/core/java/android/view/InputDevice.java b/core/java/android/view/InputDevice.java index f39d1f5..cc4598d 100644 --- a/core/java/android/view/InputDevice.java +++ b/core/java/android/view/InputDevice.java @@ -201,6 +201,35 @@ public final class InputDevice implements Parcelable { public static final int SOURCE_STYLUS = 0x00004000 | SOURCE_CLASS_POINTER; /** + * The input device is a Bluetooth stylus. + * <p> + * Note that this bit merely indicates that an input device is capable of + * obtaining input from a Bluetooth stylus. To determine whether a given + * touch event was produced by a stylus, examine the tool type returned by + * {@link MotionEvent#getToolType(int)} for each individual pointer. + * </p><p> + * A single touch event may multiple pointers with different tool types, + * such as an event that has one pointer with tool type + * {@link MotionEvent#TOOL_TYPE_FINGER} and another pointer with tool type + * {@link MotionEvent#TOOL_TYPE_STYLUS}. So it is important to examine + * the tool type of each pointer, regardless of the source reported + * by {@link MotionEvent#getSource()}. + * </p><p> + * A bluetooth stylus generally receives its pressure and button state + * information from the stylus itself, and derives the rest from another + * source. For example, a Bluetooth stylus used in conjunction with a + * touchscreen would derive its contact position and pointer size from the + * touchscreen and may not be any more accurate than other tools such as + * fingers. + * </p> + * + * @see #SOURCE_STYLUS + * @see #SOURCE_CLASS_POINTER + */ + public static final int SOURCE_BLUETOOTH_STYLUS = + 0x00008000 | SOURCE_STYLUS; + + /** * The input source is a trackball. * * @see #SOURCE_CLASS_TRACKBALL |