From 00710e906bdafd58386ee7f81fa84addd218122f Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Thu, 19 Apr 2012 15:18:26 -0700 Subject: Make InputDevice.SOURCE_STYLUS meaningful. Bug: 5424551 Change-Id: I415cb1842422e050cc41b17f5a1f13b4fab17a44 --- core/java/android/view/InputDevice.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'core/java/android/view/InputDevice.java') diff --git a/core/java/android/view/InputDevice.java b/core/java/android/view/InputDevice.java index 4848a7accf72..85f435c76116 100755 --- a/core/java/android/view/InputDevice.java +++ b/core/java/android/view/InputDevice.java @@ -167,6 +167,19 @@ public final class InputDevice implements Parcelable { /** * The input source is a stylus pointing device. + *

+ * Note that this bit merely indicates that an input device is capable of obtaining + * input from a 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. + *

+ * 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()}. + *

* * @see #SOURCE_CLASS_POINTER */ -- cgit v1.2.3