InputDeviceCompat
class InputDeviceCompat
Helper class for accessing values in android.view.InputDevice.
Summary
Constants |
|
|---|---|
const 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. |
const Int |
The input source has buttons or keys. |
const Int |
The input source is a joystick. |
const Int |
SOURCE_CLASS_MASK = 255A mask for input source classes. |
const Int |
The input source has no class. |
const Int |
The input source is a pointing device associated with a display. |
const Int |
The input source is an absolute positioning device not associated with a display (unlike |
const Int |
The input source is a trackball navigation device. |
const Int |
SOURCE_DPAD = 513The input source is a DPad. |
const Int |
SOURCE_GAMEPAD = 1025The input source is a game pad. |
const Int |
SOURCE_HDMI = 33554433The input source is a device connected through HDMI-based bus. |
const Int |
SOURCE_JOYSTICK = 16777232The input source is a joystick. |
const Int |
SOURCE_KEYBOARD = 257The input source is a keyboard. |
const Int |
SOURCE_MOUSE = 8194The input source is a mouse pointing device. |
const 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. |
const Int |
SOURCE_STYLUS = 16386The input source is a stylus pointing device. |
const Int |
SOURCE_TOUCHPAD = 1048584The input source is a touch pad or digitizer tablet that is not associated with a display (unlike |
const Int |
SOURCE_TOUCHSCREEN = 4098The input source is a touch screen pointing device. |
const Int |
SOURCE_TOUCH_NAVIGATION = 2097152The input source is a touch device whose motions should be interpreted as navigation events. |
const Int |
SOURCE_TRACKBALL = 65540The input source is a trackball. |
const Int |
SOURCE_UNKNOWN = 0The input source is unknown. |
Constants
SOURCE_ANY
const val SOURCE_ANY = -256: Int
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
const val SOURCE_CLASS_BUTTON = 1: Int
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
const val SOURCE_CLASS_JOYSTICK = 16: Int
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
const val SOURCE_CLASS_MASK = 255: Int
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
const val SOURCE_CLASS_NONE = 0: Int
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
const val SOURCE_CLASS_POINTER = 2: Int
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
const val SOURCE_CLASS_POSITION = 8: Int
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
const val SOURCE_CLASS_TRACKBALL = 4: Int
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
const val SOURCE_DPAD = 513: Int
The input source is a DPad.
| See also | |
|---|---|
SOURCE_CLASS_BUTTON |
SOURCE_GAMEPAD
const val SOURCE_GAMEPAD = 1025: Int
The input source is a game pad. (It may also be a SOURCE_JOYSTICK).
| See also | |
|---|---|
SOURCE_CLASS_BUTTON |
SOURCE_HDMI
const val SOURCE_HDMI = 33554433: Int
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
const val SOURCE_JOYSTICK = 16777232: Int
The input source is a joystick. (It may also be a SOURCE_GAMEPAD).
| See also | |
|---|---|
SOURCE_CLASS_JOYSTICK |
SOURCE_KEYBOARD
const val SOURCE_KEYBOARD = 257: Int
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
const val SOURCE_MOUSE = 8194: Int
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
const val SOURCE_ROTARY_ENCODER = 4194304: Int
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
const val SOURCE_STYLUS = 16386: Int
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
const val SOURCE_TOUCHPAD = 1048584: Int
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
const val SOURCE_TOUCHSCREEN = 4098: Int
The input source is a touch screen pointing device.
| See also | |
|---|---|
SOURCE_CLASS_POINTER |
SOURCE_TOUCH_NAVIGATION
const val SOURCE_TOUCH_NAVIGATION = 2097152: Int
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
const val SOURCE_TRACKBALL = 65540: Int
The input source is a trackball.
| See also | |
|---|---|
SOURCE_CLASS_TRACKBALL |