InputDeviceCompat

Added in 1.1.0

class InputDeviceCompat


Helper class for accessing values in android.view.InputDevice.

Summary

Constants

const 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.

const Int

The input source has buttons or keys.

const Int

The input source is a joystick.

const Int

A 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 SOURCE_CLASS_POINTER).

const Int

The input source is a trackball navigation device.

const Int

The input source is a DPad.

const Int

The input source is a game pad.

const Int
SOURCE_HDMI = 33554433

The input source is a device connected through HDMI-based bus.

const Int
SOURCE_JOYSTICK = 16777232

The input source is a joystick.

const Int

The input source is a keyboard.

const Int

The input source is a mouse pointing device.

const Int

The input source is a rotating encoder device whose motions should be interpreted as akin to those of a scroll wheel.

const Int

The input source is a stylus pointing device.

const Int
SOURCE_TOUCHPAD = 1048584

The input source is a touch pad or digitizer tablet that is not associated with a display (unlike SOURCE_TOUCHSCREEN).

const Int

The input source is a touch screen pointing device.

const Int

The input source is a touch device whose motions should be interpreted as navigation events.

const Int

The input source is a trackball.

const Int

The input source is unknown.

Constants

SOURCE_ANY

Added in 1.1.0
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

Added in 1.1.0
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

Added in 1.1.0
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

Added in 1.1.0
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

Added in 1.1.0
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

Added in 1.1.0
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

Added in 1.1.0
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

Added in 1.1.0
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

Added in 1.1.0
const val SOURCE_DPAD = 513: Int

The input source is a DPad.

SOURCE_GAMEPAD

Added in 1.1.0
const val SOURCE_GAMEPAD = 1025: Int

The input source is a game pad. (It may also be a SOURCE_JOYSTICK).

SOURCE_HDMI

Added in 1.1.0
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

Added in 1.1.0
const val SOURCE_JOYSTICK = 16777232: Int

The input source is a joystick. (It may also be a SOURCE_GAMEPAD).

SOURCE_KEYBOARD

Added in 1.1.0
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.

SOURCE_MOUSE

Added in 1.1.0
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.

SOURCE_ROTARY_ENCODER

Added in 1.1.0
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.

SOURCE_STYLUS

Added in 1.1.0
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.

SOURCE_TOUCHPAD

Added in 1.1.0
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).

SOURCE_TOUCHSCREEN

Added in 1.1.0
const val SOURCE_TOUCHSCREEN = 4098: Int

The input source is a touch screen pointing device.

SOURCE_TOUCH_NAVIGATION

Added in 1.1.0
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.

SOURCE_TRACKBALL

Added in 1.1.0
const val SOURCE_TRACKBALL = 65540: Int

The input source is a trackball.

SOURCE_UNKNOWN

Added in 1.1.0
const val SOURCE_UNKNOWN = 0: Int

The input source is unknown.