# InputDevice

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# InputDevice

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/view/InputDevice "View this page in Java")  

```
class InputDevice : Parcelable
```

|---|------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                       ||
| ↳ | [android.view.InputDevice](https://developer.android.com/reference/kotlin/android/view/InputDevice#) |

Describes the capabilities of a particular input device.

Each input device may support multiple classes of input. For example, a multi-function keyboard may compose the capabilities of a standard keyboard together with a track pad mouse or other pointing device.

Some input devices present multiple distinguishable sources of input. Applications can query the framework about the characteristics of each distinct source.

As a further wrinkle, different kinds of input sources uses different coordinate systems to describe motion events. Refer to the comments on the input source constants for the appropriate interpretation.

## Summary

|                                                                                                                                              Nested classes                                                                                                                                              ||
|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|   | [MotionRange](https://developer.android.com/reference/kotlin/android/view/InputDevice.MotionRange) Provides information about the range of values for a particular[MotionEvent](https://developer.android.com/reference/kotlin/android/view/MotionEvent)axis.                                         |
|   | [ViewBehavior](https://developer.android.com/reference/kotlin/android/view/InputDevice.ViewBehavior) Provides information on how views processing[MotionEvent](https://developer.android.com/reference/kotlin/android/view/MotionEvent)s generated by this input device should respond to the events. |

|                                                                                                                                                                                                                   Constants                                                                                                                                                                                                                   ||
|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [KEYBOARD_TYPE_ALPHABETIC](https://developer.android.com/reference/kotlin/android/view/InputDevice#KEYBOARD_TYPE_ALPHABETIC:kotlin.Int) The keyboard supports a complement of alphabetic keys.                                                                                                                                                              |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [KEYBOARD_TYPE_NONE](https://developer.android.com/reference/kotlin/android/view/InputDevice#KEYBOARD_TYPE_NONE:kotlin.Int) There is no keyboard.                                                                                                                                                                                                           |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [KEYBOARD_TYPE_NON_ALPHABETIC](https://developer.android.com/reference/kotlin/android/view/InputDevice#KEYBOARD_TYPE_NON_ALPHABETIC:kotlin.Int) The keyboard is not fully alphabetic.                                                                                                                                                                       |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MOTION_RANGE_ORIENTATION](https://developer.android.com/reference/kotlin/android/view/InputDevice#MOTION_RANGE_ORIENTATION:kotlin.Int) Constant for retrieving the range of values for[MotionEvent.AXIS_ORIENTATION](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_ORIENTATION:kotlin.Int).                                 |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MOTION_RANGE_PRESSURE](https://developer.android.com/reference/kotlin/android/view/InputDevice#MOTION_RANGE_PRESSURE:kotlin.Int) Constant for retrieving the range of values for[MotionEvent.AXIS_PRESSURE](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_PRESSURE:kotlin.Int).                                             |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MOTION_RANGE_SIZE](https://developer.android.com/reference/kotlin/android/view/InputDevice#MOTION_RANGE_SIZE:kotlin.Int) Constant for retrieving the range of values for[MotionEvent.AXIS_SIZE](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_SIZE:kotlin.Int).                                                             |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MOTION_RANGE_TOOL_MAJOR](https://developer.android.com/reference/kotlin/android/view/InputDevice#MOTION_RANGE_TOOL_MAJOR:kotlin.Int) Constant for retrieving the range of values for[MotionEvent.AXIS_TOOL_MAJOR](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_TOOL_MAJOR:kotlin.Int).                                     |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MOTION_RANGE_TOOL_MINOR](https://developer.android.com/reference/kotlin/android/view/InputDevice#MOTION_RANGE_TOOL_MINOR:kotlin.Int) Constant for retrieving the range of values for[MotionEvent.AXIS_TOOL_MINOR](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_TOOL_MINOR:kotlin.Int).                                     |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MOTION_RANGE_TOUCH_MAJOR](https://developer.android.com/reference/kotlin/android/view/InputDevice#MOTION_RANGE_TOUCH_MAJOR:kotlin.Int) Constant for retrieving the range of values for[MotionEvent.AXIS_TOUCH_MAJOR](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_TOUCH_MAJOR:kotlin.Int).                                 |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MOTION_RANGE_TOUCH_MINOR](https://developer.android.com/reference/kotlin/android/view/InputDevice#MOTION_RANGE_TOUCH_MINOR:kotlin.Int) Constant for retrieving the range of values for[MotionEvent.AXIS_TOUCH_MINOR](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_TOUCH_MINOR:kotlin.Int).                                 |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MOTION_RANGE_X](https://developer.android.com/reference/kotlin/android/view/InputDevice#MOTION_RANGE_X:kotlin.Int) Constant for retrieving the range of values for[MotionEvent.AXIS_X](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_X:kotlin.Int).                                                                         |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MOTION_RANGE_Y](https://developer.android.com/reference/kotlin/android/view/InputDevice#MOTION_RANGE_Y:kotlin.Int) Constant for retrieving the range of values for[MotionEvent.AXIS_Y](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_Y:kotlin.Int).                                                                         |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_ANY](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_ANY:kotlin.Int) A special input source constant that is used when filtering input devices to match devices that provide any type of input source.                                                                                                               |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_BLUETOOTH_STYLUS](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_BLUETOOTH_STYLUS:kotlin.Int) The input device is a Bluetooth stylus.                                                                                                                                                                               |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_CLASS_BUTTON](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_BUTTON:kotlin.Int) The input source has buttons or keys.                                                                                                                                                                                         |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_CLASS_JOYSTICK](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_JOYSTICK:kotlin.Int) The input source is a joystick.                                                                                                                                                                                           |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_CLASS_MASK](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_MASK:kotlin.Int) A mask for input source classes.                                                                                                                                                                                                  |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_CLASS_NONE](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_NONE:kotlin.Int) The input source has no class.                                                                                                                                                                                                    |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_CLASS_POINTER](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_POINTER:kotlin.Int) The input source is a pointing device associated with a display.                                                                                                                                                            |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_CLASS_POSITION](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_POSITION:kotlin.Int) The input source is an absolute positioning device not associated with a display (unlike[SOURCE_CLASS_POINTER](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_POINTER:kotlin.Int)). |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_CLASS_TRACKBALL](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_TRACKBALL:kotlin.Int) The input source is a trackball navigation device.                                                                                                                                                                      |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_DPAD](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_DPAD:kotlin.Int) The input source is a DPad.                                                                                                                                                                                                                   |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_GAMEPAD](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_GAMEPAD:kotlin.Int) The input source is a game pad.                                                                                                                                                                                                         |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_HDMI](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_HDMI:kotlin.Int) The input source is a device connected through HDMI-based bus.                                                                                                                                                                                |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_JOYSTICK](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_JOYSTICK:kotlin.Int) The input source is a joystick.                                                                                                                                                                                                       |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_KEYBOARD](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_KEYBOARD:kotlin.Int) The input source is a keyboard.                                                                                                                                                                                                       |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_MOUSE](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_MOUSE:kotlin.Int) The input source is a mouse pointing device.                                                                                                                                                                                                |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_MOUSE_RELATIVE](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_MOUSE_RELATIVE:kotlin.Int) The input source is a mouse device whose relative motions should be interpreted as navigation events.                                                                                                                     |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_ROTARY_ENCODER](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_ROTARY_ENCODER:kotlin.Int) The input source is a rotating encoder device whose motions should be interpreted as akin to those of a scroll wheel.                                                                                                     |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_SENSOR](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_SENSOR:kotlin.Int) The input source is a sensor associated with the input device.                                                                                                                                                                            |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_STYLUS](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_STYLUS:kotlin.Int) The input source is a stylus pointing device.                                                                                                                                                                                             |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_TOUCHPAD](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_TOUCHPAD:kotlin.Int) The input source is a touchpad (also known as a trackpad).                                                                                                                                                                            |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_TOUCHSCREEN](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_TOUCHSCREEN:kotlin.Int) The input source is a touch screen pointing device.                                                                                                                                                                             |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_TOUCH_NAVIGATION](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_TOUCH_NAVIGATION:kotlin.Int) The input source is a touch device whose motions should be interpreted as navigation events.                                                                                                                          |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_TRACKBALL](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_TRACKBALL:kotlin.Int) The input source is a trackball.                                                                                                                                                                                                    |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_UNKNOWN](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_UNKNOWN:kotlin.Int) The input source is unknown.                                                                                                                                                                                                            |

| Inherited constants ||
|---|---|
| From class[Parcelable](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#) |----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) <br /> Descriptor bit used with[describeContents()](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor. <br />                                                                                                                                                                                                        | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int) <br /> Flag for use with[writeToParcel](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)): the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". Some implementations may want to release resources at this point. <br /> | ||

|                                                                                                                                                                                                                                                                                                                                                                  Public methods                                                                                                                                                                                                                                                                                                                                                                  ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                  | [describeContents](https://developer.android.com/reference/kotlin/android/view/InputDevice#describeContents())`()` <br />                                                                                                                                                                                                                                                                                                                                                                                           |
| [BatteryState](https://developer.android.com/reference/kotlin/android/hardware/BatteryState.html#)                                                                                                                          | [getBatteryState](https://developer.android.com/reference/kotlin/android/view/InputDevice#getBatteryState())`()` Gets the battery state object associated with the device, if there is one.                                                                                                                                                                                                                                                                                                                         |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                  | [getControllerNumber](https://developer.android.com/reference/kotlin/android/view/InputDevice#getControllerNumber())`()` The controller number for a given input device.                                                                                                                                                                                                                                                                                                                                            |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!                                                                                                                                           | [getDescriptor](https://developer.android.com/reference/kotlin/android/view/InputDevice#getDescriptor())`()` Gets the input device descriptor, which is a stable identifier for an input device.                                                                                                                                                                                                                                                                                                                    |
| static[InputDevice](https://developer.android.com/reference/kotlin/android/view/InputDevice#)?                                                                                                                              | [getDevice](https://developer.android.com/reference/kotlin/android/view/InputDevice#getDevice(kotlin.Int))`(`id:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Gets information about the input device with the specified id.                                                                                                                                                                                                                                                     |
| static[IntArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int-array/index.html)!                                                                                                                                | [getDeviceIds](https://developer.android.com/reference/kotlin/android/view/InputDevice#getDeviceIds())`()` Gets the ids of all input devices in the system.                                                                                                                                                                                                                                                                                                                                                         |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                  | [getId](https://developer.android.com/reference/kotlin/android/view/InputDevice#getId())`()` Gets the input device id.                                                                                                                                                                                                                                                                                                                                                                                              |
| [KeyCharacterMap](https://developer.android.com/reference/kotlin/android/view/KeyCharacterMap)!                                                                                                                             | [getKeyCharacterMap](https://developer.android.com/reference/kotlin/android/view/InputDevice#getKeyCharacterMap())`()` Gets the key character map associated with this input device.                                                                                                                                                                                                                                                                                                                                |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                  | [getKeyCodeForKeyLocation](https://developer.android.com/reference/kotlin/android/view/InputDevice#getKeyCodeForKeyLocation(kotlin.Int))`(`locationKeyCode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Gets the[key code](https://developer.android.com/reference/kotlin/android/view/KeyEvent)produced by the given location on a reference QWERTY keyboard layout.                                                                                                           |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                  | [getKeyboardType](https://developer.android.com/reference/kotlin/android/view/InputDevice#getKeyboardType())`()` Gets the keyboard type.                                                                                                                                                                                                                                                                                                                                                                            |
| [LightsManager](https://developer.android.com/reference/kotlin/android/hardware/lights/LightsManager.html#)                                                                                                                 | [getLightsManager](https://developer.android.com/reference/kotlin/android/view/InputDevice#getLightsManager())`()` Gets the lights manager associated with the device, if there is one.                                                                                                                                                                                                                                                                                                                             |
| [InputDevice.MotionRange](https://developer.android.com/reference/kotlin/android/view/InputDevice.MotionRange)!                                                                                                             | [getMotionRange](https://developer.android.com/reference/kotlin/android/view/InputDevice#getMotionRange(kotlin.Int))`(`axis:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Gets information about the range of values for a particular[MotionEvent](https://developer.android.com/reference/kotlin/android/view/MotionEvent)axis.                                                                                                                                                 |
| [InputDevice.MotionRange](https://developer.android.com/reference/kotlin/android/view/InputDevice.MotionRange)!                                                                                                             | [getMotionRange](https://developer.android.com/reference/kotlin/android/view/InputDevice#getMotionRange(kotlin.Int,%20kotlin.Int))`(`axis:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `source:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Gets information about the range of values for a particular[MotionEvent](https://developer.android.com/reference/kotlin/android/view/MotionEvent)axis used by a particular source on the device. |
| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[InputDevice.MotionRange](https://developer.android.com/reference/kotlin/android/view/InputDevice.MotionRange)!\>! | [getMotionRanges](https://developer.android.com/reference/kotlin/android/view/InputDevice#getMotionRanges())`()` Gets the ranges for all axes supported by the device.                                                                                                                                                                                                                                                                                                                                              |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!                                                                                                                                           | [getName](https://developer.android.com/reference/kotlin/android/view/InputDevice#getName())`()` Gets the name of this input device.                                                                                                                                                                                                                                                                                                                                                                                |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                  | [getProductId](https://developer.android.com/reference/kotlin/android/view/InputDevice#getProductId())`()` Gets the product id for the given device, if available.                                                                                                                                                                                                                                                                                                                                                  |
| [SensorManager](https://developer.android.com/reference/kotlin/android/hardware/SensorManager.html#)                                                                                                                        | [getSensorManager](https://developer.android.com/reference/kotlin/android/view/InputDevice#getSensorManager())`()` Gets the sensor manager service associated with the input device.                                                                                                                                                                                                                                                                                                                                |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                  | [getSources](https://developer.android.com/reference/kotlin/android/view/InputDevice#getSources())`()` Gets the input sources supported by this input device as a combined bitfield.                                                                                                                                                                                                                                                                                                                                |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                  | [getVendorId](https://developer.android.com/reference/kotlin/android/view/InputDevice#getVendorId())`()` Gets the vendor id for the given device, if available.                                                                                                                                                                                                                                                                                                                                                     |
| [Vibrator](https://developer.android.com/reference/kotlin/android/os/Vibrator.html#)!                                                                                                                                       | [getVibrator](https://developer.android.com/reference/kotlin/android/view/InputDevice#getVibrator())`()` Gets the vibrator service associated with the device, if there is one.                                                                                                                                                                                                                                                                                                                                     |
| [VibratorManager](https://developer.android.com/reference/kotlin/android/os/VibratorManager.html#)                                                                                                                          | [getVibratorManager](https://developer.android.com/reference/kotlin/android/view/InputDevice#getVibratorManager())`()` Gets the vibrator manager associated with the device.                                                                                                                                                                                                                                                                                                                                        |
| [BooleanArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean-array/index.html)!                                                                                                                              | [hasKeys](https://developer.android.com/reference/kotlin/android/view/InputDevice#hasKeys(kotlin.Int))`(`vararg` `keys:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Gets whether the device is capable of producing the list of keycodes.                                                                                                                                                                                                                                       |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                                                          | [hasMicrophone](https://developer.android.com/reference/kotlin/android/view/InputDevice#hasMicrophone())`()` Reports whether the device has a built-in microphone.                                                                                                                                                                                                                                                                                                                                                  |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                                                          | [isEnabled](https://developer.android.com/reference/kotlin/android/view/InputDevice#isEnabled())`()` Returns true if input device is enabled.                                                                                                                                                                                                                                                                                                                                                                       |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                                                          | [isExternal](https://developer.android.com/reference/kotlin/android/view/InputDevice#isExternal())`()` Returns true if the device is external (connected to USB or Bluetooth or some other peripheral bus), otherwise it is built-in.                                                                                                                                                                                                                                                                               |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                                                          | [isVirtual](https://developer.android.com/reference/kotlin/android/view/InputDevice#isVirtual())`()` Returns true if the device is a virtual input device rather than a real one, such as the virtual keyboard (see[KeyCharacterMap.VIRTUAL_KEYBOARD](https://developer.android.com/reference/kotlin/android/view/KeyCharacterMap#VIRTUAL_KEYBOARD:kotlin.Int)).                                                                                                                                                    |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                                                          | [supportsSource](https://developer.android.com/reference/kotlin/android/view/InputDevice#supportsSource(kotlin.Int))`(`source:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Determines whether the input device supports the given source or sources.                                                                                                                                                                                                                            |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                                                                                                                            | [toString](https://developer.android.com/reference/kotlin/android/view/InputDevice#toString())`()` <br />                                                                                                                                                                                                                                                                                                                                                                                                           |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                | [writeToParcel](https://developer.android.com/reference/kotlin/android/view/InputDevice#writeToParcel(android.os.Parcel,%20kotlin.Int))`(`out:` `[Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#)`, `flags:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br />                                                                                                                                                                                  |

|                                                                                                                                                                 Properties                                                                                                                                                                  ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|
| static[Parcelable.Creator](https://developer.android.com/reference/kotlin/android/os/Parcelable.Creator.html#)\<[InputDevice](https://developer.android.com/reference/kotlin/android/view/InputDevice#)!\> | [CREATOR](https://developer.android.com/reference/kotlin/android/view/InputDevice#CREATOR:android.os.Parcelable.Creator) <br /> |

## Constants

### KEYBOARD_TYPE_ALPHABETIC

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val KEYBOARD_TYPE_ALPHABETIC: Int
```

The keyboard supports a complement of alphabetic keys.  

    Value: 2

### KEYBOARD_TYPE_NONE

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val KEYBOARD_TYPE_NONE: Int
```

There is no keyboard.  

    Value: 0

### KEYBOARD_TYPE_NON_ALPHABETIC

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val KEYBOARD_TYPE_NON_ALPHABETIC: Int
```

The keyboard is not fully alphabetic. It may be a numeric keypad or an assortment of buttons that are not mapped as alphabetic keys suitable for text input.  

    Value: 1

### MOTION_RANGE_ORIENTATION

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MOTION_RANGE_ORIENTATION: Int
```

**Deprecated:** *Use[MotionEvent.AXIS_ORIENTATION](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_ORIENTATION:kotlin.Int)instead.*

Constant for retrieving the range of values for[MotionEvent.AXIS_ORIENTATION](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_ORIENTATION:kotlin.Int).  

    Value: 8

**See Also**

### MOTION_RANGE_PRESSURE

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MOTION_RANGE_PRESSURE: Int
```

**Deprecated:** *Use[MotionEvent.AXIS_PRESSURE](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_PRESSURE:kotlin.Int)instead.*

Constant for retrieving the range of values for[MotionEvent.AXIS_PRESSURE](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_PRESSURE:kotlin.Int).  

    Value: 2

**See Also**

### MOTION_RANGE_SIZE

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MOTION_RANGE_SIZE: Int
```

**Deprecated:** *Use[MotionEvent.AXIS_SIZE](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_SIZE:kotlin.Int)instead.*

Constant for retrieving the range of values for[MotionEvent.AXIS_SIZE](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_SIZE:kotlin.Int).  

    Value: 3

**See Also**

### MOTION_RANGE_TOOL_MAJOR

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MOTION_RANGE_TOOL_MAJOR: Int
```

**Deprecated:** *Use[MotionEvent.AXIS_TOOL_MAJOR](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_TOOL_MAJOR:kotlin.Int)instead.*

Constant for retrieving the range of values for[MotionEvent.AXIS_TOOL_MAJOR](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_TOOL_MAJOR:kotlin.Int).  

    Value: 6

**See Also**

### MOTION_RANGE_TOOL_MINOR

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MOTION_RANGE_TOOL_MINOR: Int
```

**Deprecated:** *Use[MotionEvent.AXIS_TOOL_MINOR](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_TOOL_MINOR:kotlin.Int)instead.*

Constant for retrieving the range of values for[MotionEvent.AXIS_TOOL_MINOR](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_TOOL_MINOR:kotlin.Int).  

    Value: 7

**See Also**

### MOTION_RANGE_TOUCH_MAJOR

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MOTION_RANGE_TOUCH_MAJOR: Int
```

**Deprecated:** *Use[MotionEvent.AXIS_TOUCH_MAJOR](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_TOUCH_MAJOR:kotlin.Int)instead.*

Constant for retrieving the range of values for[MotionEvent.AXIS_TOUCH_MAJOR](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_TOUCH_MAJOR:kotlin.Int).  

    Value: 4

**See Also**

### MOTION_RANGE_TOUCH_MINOR

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MOTION_RANGE_TOUCH_MINOR: Int
```

**Deprecated:** *Use[MotionEvent.AXIS_TOUCH_MINOR](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_TOUCH_MINOR:kotlin.Int)instead.*

Constant for retrieving the range of values for[MotionEvent.AXIS_TOUCH_MINOR](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_TOUCH_MINOR:kotlin.Int).  

    Value: 5

**See Also**

### MOTION_RANGE_X

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MOTION_RANGE_X: Int
```

**Deprecated:** *Use[MotionEvent.AXIS_X](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_X:kotlin.Int)instead.*

Constant for retrieving the range of values for[MotionEvent.AXIS_X](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_X:kotlin.Int).  

    Value: 0

**See Also**

### MOTION_RANGE_Y

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MOTION_RANGE_Y: Int
```

**Deprecated:** *Use[MotionEvent.AXIS_Y](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_Y:kotlin.Int)instead.*

Constant for retrieving the range of values for[MotionEvent.AXIS_Y](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_Y:kotlin.Int).  

    Value: 1

**See Also**

### SOURCE_ANY

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_ANY: Int
```

A special input source constant that is used when filtering input devices to match devices that provide any type of input source.  

    Value: -256

### SOURCE_BLUETOOTH_STYLUS

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_BLUETOOTH_STYLUS: Int
```

The input device is a Bluetooth stylus.

Note that this bit merely indicates that an input device is capable of obtaining input from a Bluetooth stylus. To determine whether a given touch event was produced by a stylus, examine the tool type returned by[MotionEvent.getToolType(int)](https://developer.android.com/reference/kotlin/android/view/MotionEvent#getToolType(kotlin.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](https://developer.android.com/reference/kotlin/android/view/MotionEvent#TOOL_TYPE_FINGER:kotlin.Int)and another pointer with tool type[MotionEvent.TOOL_TYPE_STYLUS](https://developer.android.com/reference/kotlin/android/view/MotionEvent#TOOL_TYPE_STYLUS:kotlin.Int). So it is important to examine the tool type of each pointer, regardless of the source reported by[MotionEvent.getSource()](https://developer.android.com/reference/kotlin/android/view/MotionEvent#getSource()).

A bluetooth stylus generally receives its pressure and button state information from the stylus itself, and derives the rest from another source. For example, a Bluetooth stylus used in conjunction with a touchscreen would derive its contact position and pointer size from the touchscreen and may not be any more accurate than other tools such as fingers.  

    Value: 49154

**See Also**

- [#SOURCE_STYLUS](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_STYLUS:kotlin.Int)
- [#SOURCE_CLASS_POINTER](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_POINTER:kotlin.Int)  

### SOURCE_CLASS_BUTTON

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_CLASS_BUTTON: Int
```

The input source has buttons or keys. Examples:[SOURCE_KEYBOARD](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_KEYBOARD:kotlin.Int),[SOURCE_DPAD](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_DPAD:kotlin.Int). A[KeyEvent](https://developer.android.com/reference/kotlin/android/view/KeyEvent)should be interpreted as a button or key press. Use[getKeyCharacterMap](https://developer.android.com/reference/kotlin/android/view/InputDevice#getKeyCharacterMap())to query the device's button and key mappings.  

    Value: 1

### SOURCE_CLASS_JOYSTICK

Added in[API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_CLASS_JOYSTICK: Int
```

The input source is a joystick. A[MotionEvent](https://developer.android.com/reference/kotlin/android/view/MotionEvent)should be interpreted as absolute joystick movements. Use #getMotionRange to query the range of positions.  

    Value: 16

### SOURCE_CLASS_MASK

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_CLASS_MASK: 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.  

    Value: 255

### SOURCE_CLASS_NONE

Added in[API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_CLASS_NONE: 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.  

    Value: 0

### SOURCE_CLASS_POINTER

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_CLASS_POINTER: Int
```

The input source is a pointing device associated with a display. Examples:[SOURCE_TOUCHSCREEN](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_TOUCHSCREEN:kotlin.Int),[SOURCE_MOUSE](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_MOUSE:kotlin.Int). A[MotionEvent](https://developer.android.com/reference/kotlin/android/view/MotionEvent)should be interpreted as absolute coordinates in display units according to the[View](https://developer.android.com/reference/kotlin/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.  

    Value: 2

### SOURCE_CLASS_POSITION

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_CLASS_POSITION: Int
```

The input source is an absolute positioning device not associated with a display (unlike[SOURCE_CLASS_POINTER](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_POINTER:kotlin.Int)). A[MotionEvent](https://developer.android.com/reference/kotlin/android/view/MotionEvent)should be interpreted as absolute coordinates in device-specific surface units. Use #getMotionRange to query the range of positions.  

    Value: 8

### SOURCE_CLASS_TRACKBALL

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_CLASS_TRACKBALL: Int
```

The input source is a trackball navigation device. Examples:[SOURCE_TRACKBALL](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_TRACKBALL:kotlin.Int). A[MotionEvent](https://developer.android.com/reference/kotlin/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.  

    Value: 4

### SOURCE_DPAD

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_DPAD: Int
```

The input source is a DPad.  

    Value: 513

**See Also**

- [#SOURCE_CLASS_BUTTON](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_BUTTON:kotlin.Int)  

### SOURCE_GAMEPAD

Added in[API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_GAMEPAD: Int
```

The input source is a game pad. (It may also be a[SOURCE_JOYSTICK](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_JOYSTICK:kotlin.Int)).  

    Value: 1025

**See Also**

- [#SOURCE_CLASS_BUTTON](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_BUTTON:kotlin.Int)  

### SOURCE_HDMI

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_HDMI: 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.  

    Value: 33554433

### SOURCE_JOYSTICK

Added in[API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_JOYSTICK: Int
```

The input source is a joystick. (It may also be a[SOURCE_GAMEPAD](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_GAMEPAD:kotlin.Int)).  

    Value: 16777232

**See Also**

- [#SOURCE_CLASS_JOYSTICK](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_JOYSTICK:kotlin.Int)  

### SOURCE_KEYBOARD

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_KEYBOARD: Int
```

The input source is a keyboard. This source indicates pretty much anything that has buttons. Use[getKeyboardType()](https://developer.android.com/reference/kotlin/android/view/InputDevice#getKeyboardType())to determine whether the keyboard has alphabetic keys and can be used to enter text.  

    Value: 257

**See Also**

- [#SOURCE_CLASS_BUTTON](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_BUTTON:kotlin.Int)  

### SOURCE_MOUSE

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_MOUSE: Int
```

The input source is a mouse pointing device. This value is also used for other mouse-like pointing devices such as touchpads and pointing sticks. When used in combination with[SOURCE_STYLUS](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_STYLUS:kotlin.Int), it denotes an external drawing tablet.  

    Value: 8194

**See Also**

- [#SOURCE_CLASS_POINTER](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_POINTER:kotlin.Int)  

### SOURCE_MOUSE_RELATIVE

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_MOUSE_RELATIVE: Int
```

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

    Value: 131076

**See Also**

- [#SOURCE_CLASS_TRACKBALL](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_TRACKBALL:kotlin.Int)  

### SOURCE_ROTARY_ENCODER

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_ROTARY_ENCODER: Int
```

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

    Value: 4194304

**See Also**

- [#SOURCE_CLASS_NONE](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_NONE:kotlin.Int)  

### SOURCE_SENSOR

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_SENSOR: Int
```

The input source is a sensor associated with the input device.  

    Value: 67108864

**See Also**

- [#SOURCE_CLASS_NONE](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_NONE:kotlin.Int)  

### SOURCE_STYLUS

Added in[API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_STYLUS: 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[MotionEvent.getToolType(int)](https://developer.android.com/reference/kotlin/android/view/MotionEvent#getToolType(kotlin.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](https://developer.android.com/reference/kotlin/android/view/MotionEvent#TOOL_TYPE_FINGER:kotlin.Int)and another pointer with tool type[MotionEvent.TOOL_TYPE_STYLUS](https://developer.android.com/reference/kotlin/android/view/MotionEvent#TOOL_TYPE_STYLUS:kotlin.Int). So it is important to examine the tool type of each pointer, regardless of the source reported by[MotionEvent.getSource()](https://developer.android.com/reference/kotlin/android/view/MotionEvent#getSource()).  

    Value: 16386

**See Also**

- [#SOURCE_CLASS_POINTER](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_POINTER:kotlin.Int)  

### SOURCE_TOUCHPAD

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_TOUCHPAD: Int
```

The input source is a touchpad (also known as a trackpad). Touchpads that are used to move the mouse cursor will also have[SOURCE_MOUSE](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_MOUSE:kotlin.Int).  

    Value: 1048584

**See Also**

- [#SOURCE_CLASS_POSITION](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_POSITION:kotlin.Int)  

### SOURCE_TOUCHSCREEN

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_TOUCHSCREEN: Int
```

The input source is a touch screen pointing device.  

    Value: 4098

**See Also**

- [#SOURCE_CLASS_POINTER](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_POINTER:kotlin.Int)  

### SOURCE_TOUCH_NAVIGATION

Added in[API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_TOUCH_NAVIGATION: 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.  

    Value: 2097152

**See Also**

- [#SOURCE_CLASS_NONE](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_NONE:kotlin.Int)  

### SOURCE_TRACKBALL

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_TRACKBALL: Int
```

The input source is a trackball.  

    Value: 65540

**See Also**

- [#SOURCE_CLASS_TRACKBALL](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_TRACKBALL:kotlin.Int)  

### SOURCE_UNKNOWN

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SOURCE_UNKNOWN: Int
```

The input source is unknown.  

    Value: 0

## Public methods

### describeContents

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun describeContents(): Int
```

|                                                                                                                                                                               Return                                                                                                                                                                               ||
|----------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either`0`or[android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) |

### getBatteryState

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getBatteryState(): BatteryState
```

Gets the battery state object associated with the device, if there is one. Even if the device does not have a battery, the result is never null. Use[BatteryState.isPresent](https://developer.android.com/reference/kotlin/android/hardware/BatteryState.html#isPresent())to determine whether a battery is present.

|                                                                             Return                                                                             ||
|----------------------------------------------------------------------------------------------------|------------------------------------------------------------|
| [BatteryState](https://developer.android.com/reference/kotlin/android/hardware/BatteryState.html#) | The battery object associated with the device, never null. |

### getControllerNumber

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getControllerNumber(): Int
```

The controller number for a given input device.

Each gamepad or joystick is given a unique, positive controller number when initially configured by the system. This number may change due to events such as device disconnects / reconnects or user initiated reassignment. Any change in number will trigger an event that can be observed by registering an[android.hardware.input.InputManager.InputDeviceListener](https://developer.android.com/reference/kotlin/android/hardware/input/InputManager.InputDeviceListener.html#).

All input devices which are not gamepads or joysticks will be assigned a controller number of 0.

|                                                      Return                                                      ||
|----------------------------------------------------------------------------|--------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | The controller number of the device. |

### getDescriptor

Added in[API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getDescriptor(): String!
```

Gets the input device descriptor, which is a stable identifier for an input device.

An input device descriptor uniquely identifies an input device. Its value is intended to be persistent across system restarts, and should not change even if the input device is disconnected, reconnected or reconfigured at any time.

It is possible for there to be multiple[InputDevice](https://developer.android.com/reference/kotlin/android/view/InputDevice#)instances that have the same input device descriptor. This might happen in situations where a single human input device registers multiple[InputDevice](https://developer.android.com/reference/kotlin/android/view/InputDevice#)instances (HID collections) that describe separate features of the device, such as a keyboard that also has a touchpad. Alternately, it may be that the input devices are simply indistinguishable, such as two keyboards made by the same manufacturer.

The input device descriptor returned by[getDescriptor](https://developer.android.com/reference/kotlin/android/view/InputDevice#getDescriptor())should only be used when an application needs to remember settings associated with a particular input device. For all other purposes when referring to a logical[InputDevice](https://developer.android.com/reference/kotlin/android/view/InputDevice#)instance at runtime use the id returned by[getId()](https://developer.android.com/reference/kotlin/android/view/InputDevice#getId()).

|                                                     Return                                                      ||
|-----------------------------------------------------------------------------------|------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | The input device descriptor. |

### getDevice

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static fun getDevice(id: Int): InputDevice?
```

Gets information about the input device with the specified id.

|                                           Parameters                                            ||
|------|-------------------------------------------------------------------------------------------|
| `id` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The device id. |

|                                                              Return                                                              ||
|------------------------------------------------------------------------------------------|----------------------------------------|
| [InputDevice](https://developer.android.com/reference/kotlin/android/view/InputDevice#)? | The input device or null if not found. |

### getDeviceIds

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static fun getDeviceIds(): IntArray!
```

Gets the ids of all input devices in the system.

|                                                    Return                                                     ||
|----------------------------------------------------------------------------------------|-----------------------|
| [IntArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int-array/index.html)! | The input device ids. |

### getId

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getId(): Int
```

Gets the input device id.

Each input device receives a unique id when it is first configured by the system. The input device id may change when the system is restarted or if the input device is disconnected, reconnected or reconfigured at any time. If you require a stable identifier for a device that persists across boots and reconfigurations, use[getDescriptor()](https://developer.android.com/reference/kotlin/android/view/InputDevice#getDescriptor()).

|                                              Return                                              ||
|----------------------------------------------------------------------------|----------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | The input device id. |

### getKeyCharacterMap

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getKeyCharacterMap(): KeyCharacterMap!
```

Gets the key character map associated with this input device.

|                                                         Return                                                          ||
|-------------------------------------------------------------------------------------------------|------------------------|
| [KeyCharacterMap](https://developer.android.com/reference/kotlin/android/view/KeyCharacterMap)! | The key character map. |

### getKeyCodeForKeyLocation

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getKeyCodeForKeyLocation(locationKeyCode: Int): Int
```

Gets the[key code](https://developer.android.com/reference/kotlin/android/view/KeyEvent)produced by the given location on a reference QWERTY keyboard layout.

This API is useful for querying the physical location of keys that change the character produced based on the current locale and keyboard layout.

The following table provides a non-exhaustive list of examples:

| Active Keyboard Layout |                                                 Input Parameter                                                 |                                                  Return Value                                                   |
|------------------------|-----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
| French AZERTY          | [KeyEvent.KEYCODE_Q](https://developer.android.com/reference/kotlin/android/view/KeyEvent#KEYCODE_Q:kotlin.Int) | [KeyEvent.KEYCODE_A](https://developer.android.com/reference/kotlin/android/view/KeyEvent#KEYCODE_A:kotlin.Int) |
| German QWERTZ          | [KeyEvent.KEYCODE_Y](https://developer.android.com/reference/kotlin/android/view/KeyEvent#KEYCODE_Y:kotlin.Int) | [KeyEvent.KEYCODE_Z](https://developer.android.com/reference/kotlin/android/view/KeyEvent#KEYCODE_Z:kotlin.Int) |
| US QWERTY              | [KeyEvent.KEYCODE_B](https://developer.android.com/reference/kotlin/android/view/KeyEvent#KEYCODE_B:kotlin.Int) | [KeyEvent.KEYCODE_B](https://developer.android.com/reference/kotlin/android/view/KeyEvent#KEYCODE_B:kotlin.Int) |

|                                                                                                                                                                                                                                                    Parameters                                                                                                                                                                                                                                                     ||
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `locationKeyCode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The location of a key specified as a key code on the QWERTY layout. This provides a consistent way of referring to the physical location of a key independently of the current keyboard layout. Also see the[hypothetical keyboard](https://www.w3.org/TR/2017/CR-uievents-code-20170601/#key-alphanumeric-writing-system)provided by the W3C, which may be helpful for identifying the physical location of a key. |

|                                                                                                                                                                                                                                                           Return                                                                                                                                                                                                                                                           ||
|----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | The key code produced by the key at the specified location, given the current keyboard layout. Returns[KeyEvent.KEYCODE_UNKNOWN](https://developer.android.com/reference/kotlin/android/view/KeyEvent#KEYCODE_UNKNOWN:kotlin.Int)if the device does not specify[InputDevice.SOURCE_KEYBOARD](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_KEYBOARD:kotlin.Int)or the requested mapping cannot be determined. |

### getKeyboardType

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getKeyboardType(): Int
```

Gets the keyboard type.

|                                             Return                                             ||
|----------------------------------------------------------------------------|--------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | The keyboard type. |

### getLightsManager

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getLightsManager(): LightsManager
```

Gets the lights manager associated with the device, if there is one. Even if the device does not have lights, the result is never null. Use[LightsManager.getLights](https://developer.android.com/reference/kotlin/android/hardware/lights/LightsManager.html#getLights())to determine whether any lights is present.

|                                                                                 Return                                                                                  ||
|-------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|
| [LightsManager](https://developer.android.com/reference/kotlin/android/hardware/lights/LightsManager.html#) | The lights manager associated with the device, never null. |

### getMotionRange

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getMotionRange(axis: Int): InputDevice.MotionRange!
```

Gets information about the range of values for a particular[MotionEvent](https://developer.android.com/reference/kotlin/android/view/MotionEvent)axis. If the device supports multiple sources, the same axis may have different meanings for each source. Returns information about the first axis found for any source. To obtain information about the axis for a specific source, use[getMotionRange(int,int)](https://developer.android.com/reference/kotlin/android/view/InputDevice#getMotionRange(kotlin.Int,%20kotlin.Int)).

|                                              Parameters                                               ||
|--------|-----------------------------------------------------------------------------------------------|
| `axis` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The axis constant. |

|                                                                                               Return                                                                                                ||
|-----------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| [InputDevice.MotionRange](https://developer.android.com/reference/kotlin/android/view/InputDevice.MotionRange)! | The range of values, or null if the requested axis is not supported by the device. |

**See Also**

- [android.view.MotionEvent#AXIS_X](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_X:kotlin.Int)
- [android.view.MotionEvent#AXIS_Y](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_Y:kotlin.Int)  

### getMotionRange

Added in[API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getMotionRange(
    axis: Int, 
    source: Int
): InputDevice.MotionRange!
```

Gets information about the range of values for a particular[MotionEvent](https://developer.android.com/reference/kotlin/android/view/MotionEvent)axis used by a particular source on the device. If the device supports multiple sources, the same axis may have different meanings for each source.

|                                                            Parameters                                                            ||
|----------|------------------------------------------------------------------------------------------------------------------------|
| `axis`   | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The axis constant.                          |
| `source` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The source for which to return information. |

|                                                                                               Return                                                                                                ||
|-----------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| [InputDevice.MotionRange](https://developer.android.com/reference/kotlin/android/view/InputDevice.MotionRange)! | The range of values, or null if the requested axis is not supported by the device. |

**See Also**

- [android.view.MotionEvent#AXIS_X](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_X:kotlin.Int)
- [android.view.MotionEvent#AXIS_Y](https://developer.android.com/reference/kotlin/android/view/MotionEvent#AXIS_Y:kotlin.Int)  

### getMotionRanges

Added in[API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getMotionRanges(): MutableList<InputDevice.MotionRange!>!
```

Gets the ranges for all axes supported by the device.

|                                                                                                                            Return                                                                                                                            ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------|
| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)<[InputDevice.MotionRange](https://developer.android.com/reference/kotlin/android/view/InputDevice.MotionRange)!>! | The motion ranges for the device. |

**See Also**

- [#getMotionRange(int, int)](https://developer.android.com/reference/kotlin/android/view/InputDevice#getMotionRange(kotlin.Int,%20kotlin.Int))  

### getName

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getName(): String!
```

Gets the name of this input device.

|                                                  Return                                                   ||
|-----------------------------------------------------------------------------------|------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | The input device name. |

### getProductId

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getProductId(): Int
```

Gets the product id for the given device, if available.

A product id uniquely identifies which product within the address space of a given vendor, identified by the device's vendor id. A value of 0 will be assigned where a product id is not available.

|                                                    Return                                                    ||
|----------------------------------------------------------------------------|----------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | The product id of a given device |

### getSensorManager

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getSensorManager(): SensorManager
```

Gets the sensor manager service associated with the input device. Even if the device does not have a sensor, the result is never null. Use[SensorManager.getSensorList](https://developer.android.com/reference/kotlin/android/hardware/SensorManager.html#getSensorList(kotlin.Int))to get a full list of all supported sensors. Note that the sensors associated with the device may be different from the system sensors, as typically they are builtin sensors physically attached to input devices.

|                                                                                  Return                                                                                  ||
|------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|
| [SensorManager](https://developer.android.com/reference/kotlin/android/hardware/SensorManager.html#) | The sensor manager service associated with the device, never null. |

### getSources

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getSources(): Int
```

Gets the input sources supported by this input device as a combined bitfield.

|                                                  Return                                                  ||
|----------------------------------------------------------------------------|------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | The supported input sources. |

### getVendorId

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getVendorId(): Int
```

Gets the vendor id for the given device, if available.

A vendor id uniquely identifies the company who manufactured the device. A value of 0 will be assigned where a vendor id is not available.

|                                                   Return                                                    ||
|----------------------------------------------------------------------------|---------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | The vendor id of a given device |

### getVibrator

Added in[API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getVibrator(): Vibrator!
```

**Deprecated:** *Use[getVibratorManager()](https://developer.android.com/reference/kotlin/android/view/InputDevice#getVibratorManager())to retrieve the default device vibrator.*

Gets the vibrator service associated with the device, if there is one. Even if the device does not have a vibrator, the result is never null. Use[Vibrator.hasVibrator](https://developer.android.com/reference/kotlin/android/os/Vibrator.html#hasVibrator())to determine whether a vibrator is present. Note that the vibrator associated with the device may be different from the system vibrator. To obtain an instance of the system vibrator instead, call android.content.Context#getSystemService with[Context.VIBRATOR_SERVICE](https://developer.android.com/reference/kotlin/android/content/Context.html#VIBRATOR_SERVICE:kotlin.String)as argument.

|                                                                       Return                                                                        ||
|---------------------------------------------------------------------------------------|--------------------------------------------------------------|
| [Vibrator](https://developer.android.com/reference/kotlin/android/os/Vibrator.html#)! | The vibrator service associated with the device, never null. |

### getVibratorManager

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getVibratorManager(): VibratorManager
```

Gets the vibrator manager associated with the device. Even if the device does not have a vibrator manager, the result is never null. Use[VibratorManager.getVibratorIds](https://developer.android.com/reference/kotlin/android/os/VibratorManager.html#getVibratorIds())to determine whether any vibrator is present.

|                                                                              Return                                                                              ||
|----------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| [VibratorManager](https://developer.android.com/reference/kotlin/android/os/VibratorManager.html#) | The vibrator manager associated with the device, never null. |

### hasKeys

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun hasKeys(vararg keys: Int): BooleanArray!
```

Gets whether the device is capable of producing the list of keycodes.

|                                                          Parameters                                                           ||
|--------|-----------------------------------------------------------------------------------------------------------------------|
| `keys` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The list of android keycodes to check for. |

|                                                                                                                                     Return                                                                                                                                     ||
|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [BooleanArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean-array/index.html)! | An array of booleans where each member specifies whether the device is capable of generating the keycode given by the corresponding value at the same index in the keys array. |

### hasMicrophone

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun hasMicrophone(): Boolean
```

Reports whether the device has a built-in microphone.

|                                                              Return                                                               ||
|------------------------------------------------------------------------------------|-----------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | Whether the device has a built-in microphone. |

### isEnabled

Added in[API level 27](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun isEnabled(): Boolean
```

Returns true if input device is enabled.

|                                                          Return                                                          ||
|------------------------------------------------------------------------------------|--------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | Whether the input device is enabled. |

### isExternal

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun isExternal(): Boolean
```

Returns true if the device is external (connected to USB or Bluetooth or some other peripheral bus), otherwise it is built-in.

|                                                       Return                                                        ||
|------------------------------------------------------------------------------------|---------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | True if the device is external. |

### isVirtual

Added in[API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun isVirtual(): Boolean
```

Returns true if the device is a virtual input device rather than a real one, such as the virtual keyboard (see[KeyCharacterMap.VIRTUAL_KEYBOARD](https://developer.android.com/reference/kotlin/android/view/KeyCharacterMap#VIRTUAL_KEYBOARD:kotlin.Int)).

Virtual input devices are provided to implement system-level functionality and should not be seen or configured by users.

|                                                       Return                                                       ||
|------------------------------------------------------------------------------------|--------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | True if the device is virtual. |

**See Also**

- [android.view.KeyCharacterMap#VIRTUAL_KEYBOARD](https://developer.android.com/reference/kotlin/android/view/KeyCharacterMap#VIRTUAL_KEYBOARD:kotlin.Int)  

### supportsSource

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun supportsSource(source: Int): Boolean
```

Determines whether the input device supports the given source or sources.

|                                                                                                                                                                                                                                                                  Parameters                                                                                                                                                                                                                                                                  ||
|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `source` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The input source or sources to check against. This can be a generic device type such as[InputDevice.SOURCE_MOUSE](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_MOUSE:kotlin.Int), a more generic device class, such as[InputDevice.SOURCE_CLASS_POINTER](https://developer.android.com/reference/kotlin/android/view/InputDevice#SOURCE_CLASS_POINTER:kotlin.Int), or a combination of sources bitwise ORed together. |

|                                                                    Return                                                                    ||
|------------------------------------------------------------------------------------|----------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | Whether the device can produce all of the given sources. |

### toString

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun toString(): String
```

|                                                          Return                                                          ||
|----------------------------------------------------------------------------------|----------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |

### writeToParcel

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun writeToParcel(
    out: Parcel, 
    flags: Int
): Unit
```

|                                                                                                                                                                                                                                                                                     Parameters                                                                                                                                                                                                                                                                                     ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dest`  | The Parcel in which the object should be written. This value cannot be`null`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Additional flags about how the object should be written. May be 0 or[PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int). Value is either`0`or a combination of[android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int), and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |

## Properties

### CREATOR

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val CREATOR: Parcelable.Creator<InputDevice!>
```