InputDeviceCompat
public final class InputDeviceCompat
Helper class for accessing values in android.view.InputDevice.
Summary
Constants |
|
|---|---|
static final int |
SOURCE_ANY = -256A special input source constant that is used when filtering input devices to match devices that provide any type of input source. |
static final int |
The input source has buttons or keys. |
static final int |
The input source is a joystick. |
static final int |
SOURCE_CLASS_MASK = 255A mask for input source classes. |
static final int |
The input source has no class. |
static final int |
The input source is a pointing device associated with a display. |
static final int |
The input source is an absolute positioning device not associated with a display (unlike |
static final int |
The input source is a trackball navigation device. |
static final int |
SOURCE_DPAD = 513The input source is a DPad. |
static final int |
SOURCE_GAMEPAD = 1025The input source is a game pad. |
static final int |
SOURCE_HDMI = 33554433The input source is a device connected through HDMI-based bus. |
static final int |
SOURCE_JOYSTICK = 16777232The input source is a joystick. |
static final int |
SOURCE_KEYBOARD = 257The input source is a keyboard. |
static final int |
SOURCE_MOUSE = 8194The input source is a mouse pointing device. |
static final int |
SOURCE_ROTARY_ENCODER = 4194304The input source is a rotating encoder device whose motions should be interpreted as akin to those of a scroll wheel. |
static final int |
SOURCE_STYLUS = 16386The input source is a stylus pointing device. |
static final int |
SOURCE_TOUCHPAD = 1048584The input source is a touch pad or digitizer tablet that is not associated with a display (unlike |
static final int |
SOURCE_TOUCHSCREEN = 4098The input source is a touch screen pointing device. |
static final int |
SOURCE_TOUCH_NAVIGATION = 2097152The input source is a touch device whose motions should be interpreted as navigation events. |
static final int |
SOURCE_TRACKBALL = 65540The input source is a trackball. |
static final int |
SOURCE_UNKNOWN = 0The input source is unknown. |
Constants
SOURCE_ANY
public static final int SOURCE_ANY = -256
A special input source constant that is used when filtering input devices to match devices that provide any type of input source.
SOURCE_CLASS_BUTTON
public static final int SOURCE_CLASS_BUTTON = 1
The input source has buttons or keys. Examples: SOURCE_KEYBOARD, SOURCE_DPAD. A android.view.KeyEvent should be interpreted as a button or key press.
SOURCE_CLASS_JOYSTICK
public static final int SOURCE_CLASS_JOYSTICK = 16
The input source is a joystick. A android.view.MotionEvent should be interpreted as absolute joystick movements. Use getMotionRange to query the range of positions.
SOURCE_CLASS_MASK
public static final int SOURCE_CLASS_MASK = 255
A mask for input source classes. Each distinct input source constant has one or more input source class bits set to specify the desired interpretation for its input events.
SOURCE_CLASS_NONE
public static final int SOURCE_CLASS_NONE = 0
The input source has no class. It is up to the application to determine how to handle the device based on the device type.
SOURCE_CLASS_POINTER
public static final int SOURCE_CLASS_POINTER = 2
The input source is a pointing device associated with a display. Examples: SOURCE_TOUCHSCREEN, SOURCE_MOUSE. A android.view.MotionEvent should be interpreted as absolute coordinates in display units according to the android.view.View hierarchy. Pointer down/up indicated when the finger touches the display or when the selection button is pressed/released. Use getMotionRange 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.
SOURCE_CLASS_POSITION
public static final int SOURCE_CLASS_POSITION = 8
The input source is an absolute positioning device not associated with a display (unlike SOURCE_CLASS_POINTER). A android.view.MotionEvent should be interpreted as absolute coordinates in device-specific surface units. Use getMotionRange to query the range of positions.
SOURCE_CLASS_TRACKBALL
public static final int SOURCE_CLASS_TRACKBALL = 4
The input source is a trackball navigation device. Examples: SOURCE_TRACKBALL. A android.view.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 getMotionRange to query the range of motion.
SOURCE_DPAD
public static final int SOURCE_DPAD = 513
The input source is a DPad.
| See also | |
|---|---|
SOURCE_CLASS_BUTTON |
SOURCE_GAMEPAD
public static final int SOURCE_GAMEPAD = 1025
The input source is a game pad. (It may also be a SOURCE_JOYSTICK).
| See also | |
|---|---|
SOURCE_CLASS_BUTTON |
SOURCE_HDMI
public static final int SOURCE_HDMI = 33554433
The input source is a device connected through HDMI-based bus. The key comes in through HDMI-CEC or MHL signal line, and is treated as if it were generated by a locally connected DPAD or keyboard.
SOURCE_JOYSTICK
public static final int SOURCE_JOYSTICK = 16777232
The input source is a joystick. (It may also be a SOURCE_GAMEPAD).
| See also | |
|---|---|
SOURCE_CLASS_JOYSTICK |
SOURCE_KEYBOARD
public static final int SOURCE_KEYBOARD = 257
The input source is a keyboard. This source indicates pretty much anything that has buttons. Use getKeyboardType to determine whether the keyboard has alphabetic keys and can be used to enter text.
| See also | |
|---|---|
SOURCE_CLASS_BUTTON |
SOURCE_MOUSE
public static final int SOURCE_MOUSE = 8194
The input source is a mouse pointing device. This code is also used for other mouse-like pointing devices such as trackpads and trackpoints.
| See also | |
|---|---|
SOURCE_CLASS_POINTER |
SOURCE_ROTARY_ENCODER
public static final int SOURCE_ROTARY_ENCODER = 4194304
The input source is a rotating encoder device whose motions should be interpreted as akin to those of a scroll wheel.
| See also | |
|---|---|
SOURCE_CLASS_NONE |
SOURCE_STYLUS
public static final int SOURCE_STYLUS = 16386
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 getToolType 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 TOOL_TYPE_FINGER and another pointer with tool type TOOL_TYPE_STYLUS. So it is important to examine the tool type of each pointer, regardless of the source reported by getSource.
| See also | |
|---|---|
SOURCE_CLASS_POINTER |
SOURCE_TOUCHPAD
public static final int SOURCE_TOUCHPAD = 1048584
The input source is a touch pad or digitizer tablet that is not associated with a display (unlike SOURCE_TOUCHSCREEN).
| See also | |
|---|---|
SOURCE_CLASS_POSITION |
SOURCE_TOUCHSCREEN
public static final int SOURCE_TOUCHSCREEN = 4098
The input source is a touch screen pointing device.
| See also | |
|---|---|
SOURCE_CLASS_POINTER |
SOURCE_TOUCH_NAVIGATION
public static final int SOURCE_TOUCH_NAVIGATION = 2097152
The input source is a touch device whose motions should be interpreted as navigation events. For example, an upward swipe should be as an upward focus traversal in the same manner as pressing up on a D-Pad would be. Swipes to the left, right and down should be treated in a similar manner.
| See also | |
|---|---|
SOURCE_CLASS_NONE |
SOURCE_TRACKBALL
public static final int SOURCE_TRACKBALL = 65540
The input source is a trackball.
| See also | |
|---|---|
SOURCE_CLASS_TRACKBALL |
SOURCE_UNKNOWN
public static final int SOURCE_UNKNOWN = 0
The input source is unknown.