public final class InputDeviceCompat extends Object
InputDevice
.Modifier and Type | Field and Description |
---|---|
static int |
SOURCE_ANY
A special input source constant that is used when filtering input devices
to match devices that provide any type of input source.
|
static int |
SOURCE_CLASS_BUTTON
The input source has buttons or keys.
|
static int |
SOURCE_CLASS_JOYSTICK
The input source is a joystick.
|
static int |
SOURCE_CLASS_MASK
A mask for input source classes.
|
static int |
SOURCE_CLASS_NONE
The input source has no class.
|
static int |
SOURCE_CLASS_POINTER
The input source is a pointing device associated with a display.
|
static int |
SOURCE_CLASS_POSITION
The input source is an absolute positioning device not associated with a display
(unlike
SOURCE_CLASS_POINTER ). |
static int |
SOURCE_CLASS_TRACKBALL
The input source is a trackball navigation device.
|
static int |
SOURCE_DPAD
The input source is a DPad.
|
static int |
SOURCE_GAMEPAD
The input source is a game pad.
|
static int |
SOURCE_HDMI
The input source is a device connected through HDMI-based bus.
|
static int |
SOURCE_JOYSTICK
The input source is a joystick.
|
static int |
SOURCE_KEYBOARD
The input source is a keyboard.
|
static int |
SOURCE_MOUSE
The input source is a mouse pointing device.
|
static int |
SOURCE_STYLUS
The input source is a stylus pointing device.
|
static int |
SOURCE_TOUCH_NAVIGATION
The input source is a touch device whose motions should be interpreted as navigation events.
|
static int |
SOURCE_TOUCHPAD
The input source is a touch pad or digitizer tablet that is not
associated with a display (unlike
SOURCE_TOUCHSCREEN ). |
static int |
SOURCE_TOUCHSCREEN
The input source is a touch screen pointing device.
|
static int |
SOURCE_TRACKBALL
The input source is a trackball.
|
static int |
SOURCE_UNKNOWN
The input source is unknown.
|
public static final int SOURCE_CLASS_MASK
public static final int SOURCE_CLASS_NONE
public static final int SOURCE_CLASS_BUTTON
SOURCE_KEYBOARD
, SOURCE_DPAD
.
A KeyEvent
should be interpreted as a button or key press.public static final int SOURCE_CLASS_POINTER
SOURCE_TOUCHSCREEN
, SOURCE_MOUSE
.
A MotionEvent
should be interpreted as absolute coordinates in
display units according to the View
hierarchy. Pointer down/up
indicated when
the finger touches the display or when the selection button is pressed/released.
Use InputDevice.getMotionRange(int)
to query the range of the pointing
device. Some devices permit
touches outside the display area so the effective range may be somewhat smaller or larger
than the actual display size.public static final int SOURCE_CLASS_TRACKBALL
SOURCE_TRACKBALL
.
A MotionEvent
should be interpreted as relative movements in
device-specific
units used for navigation purposes. Pointer down/up indicates when the selection button
is pressed/released.
Use InputDevice.getMotionRange(int)
to query the range of motion.public static final int SOURCE_CLASS_POSITION
SOURCE_CLASS_POINTER
).
A MotionEvent
should be interpreted as absolute coordinates in
device-specific surface units.
Use InputDevice.getMotionRange(int)
to query the range of positions.public static final int SOURCE_CLASS_JOYSTICK
MotionEvent
should be interpreted as absolute joystick movements.
Use InputDevice.getMotionRange(int)
to query the range of positions.public static final int SOURCE_UNKNOWN
public static final int SOURCE_KEYBOARD
InputDevice.getKeyboardType()
to determine whether the keyboard has
alphabetic keys
and can be used to enter text.SOURCE_CLASS_BUTTON
,
Constant Field Valuespublic static final int SOURCE_DPAD
SOURCE_CLASS_BUTTON
,
Constant Field Valuespublic static final int SOURCE_GAMEPAD
SOURCE_JOYSTICK
).SOURCE_CLASS_BUTTON
,
Constant Field Valuespublic static final int SOURCE_TOUCHSCREEN
SOURCE_CLASS_POINTER
,
Constant Field Valuespublic static final int SOURCE_MOUSE
SOURCE_CLASS_POINTER
,
Constant Field Valuespublic static final int SOURCE_STYLUS
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 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
MotionEvent.TOOL_TYPE_FINGER
and another pointer with tool type
MotionEvent.TOOL_TYPE_STYLUS
. So it is important to examine
the tool type of each pointer, regardless of the source reported
by MotionEvent.getSource()
.
SOURCE_CLASS_POINTER
,
Constant Field Valuespublic static final int SOURCE_TRACKBALL
SOURCE_CLASS_TRACKBALL
,
Constant Field Valuespublic static final int SOURCE_TOUCHPAD
SOURCE_TOUCHSCREEN
).SOURCE_CLASS_POSITION
,
Constant Field Valuespublic static final int SOURCE_TOUCH_NAVIGATION
SOURCE_CLASS_NONE
,
Constant Field Valuespublic static final int SOURCE_JOYSTICK
SOURCE_GAMEPAD
).SOURCE_CLASS_JOYSTICK
,
Constant Field Valuespublic static final int SOURCE_HDMI
public static final int SOURCE_ANY