summaryrefslogtreecommitdiff
path: root/core/java/android/view/InputDevice.java
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-01-15 18:14:15 -0800
committerJeff Brown <jeffbrown@google.com>2011-01-17 13:51:00 -0800
commitcb1404e45639d20439d7700b06d57ca1a1aad1fa (patch)
tree1d9bb7c58ea0a9ae36c242602fca59d343e8a0cd /core/java/android/view/InputDevice.java
parente0dfee2b7075c1eac0db08d79d47381693d2f125 (diff)
Add joystick support to framework.
Change-Id: I95374436708752e1a9cff3f85c5b9bc3e0987961
Diffstat (limited to 'core/java/android/view/InputDevice.java')
-rwxr-xr-xcore/java/android/view/InputDevice.java31
1 files changed, 28 insertions, 3 deletions
diff --git a/core/java/android/view/InputDevice.java b/core/java/android/view/InputDevice.java
index dd04975c11d6..e799f7696c65 100755
--- a/core/java/android/view/InputDevice.java
+++ b/core/java/android/view/InputDevice.java
@@ -98,7 +98,16 @@ public final class InputDevice implements Parcelable {
* Use {@link #getMotionRange} to query the range of positions.
*/
public static final int SOURCE_CLASS_POSITION = 0x00000008;
-
+
+ /**
+ * The input source is a joystick.
+ *
+ * A {@link MotionEvent} should be interpreted as absolute joystick movements.
+ *
+ * Use {@link #getMotionRange} to query the range of positions.
+ */
+ public static final int SOURCE_CLASS_JOYSTICK = 0x00000010;
+
/**
* The input source is unknown.
*/
@@ -117,7 +126,15 @@ public final class InputDevice implements Parcelable {
* @see #SOURCE_CLASS_BUTTON
*/
public static final int SOURCE_DPAD = 0x00000200 | SOURCE_CLASS_BUTTON;
-
+
+ /**
+ * The input source is a game pad.
+ * (It may also be a {@link #SOURCE_JOYSTICK}).
+ *
+ * @see #SOURCE_CLASS_BUTTON
+ */
+ public static final int SOURCE_GAMEPAD = 0x00000400 | SOURCE_CLASS_BUTTON;
+
/**
* The input source is a touch screen pointing device.
*
@@ -148,7 +165,15 @@ public final class InputDevice implements Parcelable {
* @see #SOURCE_CLASS_POSITION
*/
public static final int SOURCE_TOUCHPAD = 0x00100000 | SOURCE_CLASS_POSITION;
-
+
+ /**
+ * The input source is a joystick.
+ * (It may also be a {@link #SOURCE_GAMEPAD}).
+ *
+ * @see #SOURCE_CLASS_JOYSTICK
+ */
+ public static final int SOURCE_JOYSTICK = 0x01000000 | SOURCE_CLASS_JOYSTICK;
+
/**
* A special input source constant that is used when filtering input devices
* to match devices that provide any type of input source.