From cb1404e45639d20439d7700b06d57ca1a1aad1fa Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Sat, 15 Jan 2011 18:14:15 -0800 Subject: Add joystick support to framework. Change-Id: I95374436708752e1a9cff3f85c5b9bc3e0987961 --- core/java/android/view/InputDevice.java | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (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 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. -- cgit v1.2.3