Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/hardware/input/InputManager#nestedclasses) \| [Constants](https://developer.android.com/reference/android/hardware/input/InputManager#constants) \| [Methods](https://developer.android.com/reference/android/hardware/input/InputManager#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/hardware/input/InputManager#inhmethods)

# InputManager

*** ** * ** ***


`
public

final

class
InputManager
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.hardware.input.InputManager |

<br />

*** ** * ** ***

Provides information about input devices and available key layouts.

## Summary

| ### Nested classes ||
|---|---|
| ` interface` | `https://developer.android.com/reference/android/hardware/input/InputManager.InputDeviceListener` Listens for changes in input devices. |

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/hardware/input/InputManager#ACTION_QUERY_KEYBOARD_LAYOUTS` Broadcast Action: Query available keyboard layouts. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/hardware/input/InputManager#META_DATA_KEYBOARD_LAYOUTS` Metadata Key: Keyboard layout metadata associated with `https://developer.android.com/reference/android/hardware/input/InputManager#ACTION_QUERY_KEYBOARD_LAYOUTS`. |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/hardware/input/InputManager#addPeripheralCustomization(int,%20int,%20android.hardware.input.CustomizationTrigger,%20android.hardware.input.CustomizationAction)(int vendorId, int productId, https://developer.android.com/reference/android/hardware/input/CustomizationTrigger trigger, https://developer.android.com/reference/android/hardware/input/CustomizationAction action) ` Adds a new peripheral customization for a given vendor ID and product ID. |
| ` https://developer.android.com/reference/java/util/Map<https://developer.android.com/reference/android/hardware/input/CustomizationTrigger, https://developer.android.com/reference/android/hardware/input/CustomizationAction>` | ` https://developer.android.com/reference/android/hardware/input/InputManager#getAllPeripheralCustomizations(int,%20int)(int vendorId, int productId) ` Retrieves all input customizations for a specific peripheral device. |
| ` https://developer.android.com/reference/android/hardware/input/HostUsiVersion` | ` https://developer.android.com/reference/android/hardware/input/InputManager#getHostUsiVersion(android.view.Display)(https://developer.android.com/reference/android/view/Display display) ` Reports the version of the Universal Stylus Initiative (USI) protocol supported by the given display, if any. |
| ` https://developer.android.com/reference/android/view/InputDevice` | ` https://developer.android.com/reference/android/hardware/input/InputManager#getInputDevice(int)(int id) ` Gets information about the input device with the specified id. |
| ` int[]` | ` https://developer.android.com/reference/android/hardware/input/InputManager#getInputDeviceIds()() ` Gets the ids of all input devices in the system. |
| ` https://developer.android.com/reference/android/view/InputDevice.ViewBehavior` | ` https://developer.android.com/reference/android/hardware/input/InputManager#getInputDeviceViewBehavior(int)(int deviceId) ` Gets the `https://developer.android.com/reference/android/view/InputDevice.ViewBehavior` of the input device with a given `id`. |
| ` float` | ` https://developer.android.com/reference/android/hardware/input/InputManager#getMaximumObscuringOpacityForTouch()() ` Returns the maximum allowed obscuring opacity per UID to propagate touches. |
| ` https://developer.android.com/reference/android/hardware/input/CustomizationAction` | ` https://developer.android.com/reference/android/hardware/input/InputManager#getPeripheralCustomization(int,%20int,%20android.hardware.input.CustomizationTrigger)(int vendorId, int productId, https://developer.android.com/reference/android/hardware/input/CustomizationTrigger trigger) ` Retrieves a specific peripheral customization action for a given trigger. |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/input/InputManager#isButtonAllowedForCustomization(int,%20int,%20int)(int vendorId, int productId, int buttonCode) ` Checks if a specific button is allowed for customization on the device(s). |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/input/InputManager#isKeyAllowedForCustomization(int,%20int,%20int)(int vendorId, int productId, int keyCode) ` Gets whether a keycode can be customized on a device. |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/input/InputManager#isStylusPointerIconEnabled()() ` Check if showing a `https://developer.android.com/reference/android/view/PointerIcon` for styluses is enabled. |
| ` void` | ` https://developer.android.com/reference/android/hardware/input/InputManager#registerInputDeviceListener(android.hardware.input.InputManager.InputDeviceListener,%20android.os.Handler)(https://developer.android.com/reference/android/hardware/input/InputManager.InputDeviceListener listener, https://developer.android.com/reference/android/os/Handler handler) ` Registers an input device listener to receive notifications about when input devices are added, removed or changed. |
| ` void` | ` https://developer.android.com/reference/android/hardware/input/InputManager#removeAllPeripheralCustomizations(int,%20int)(int vendorId, int productId) ` Remove all peripheral customizations for a given vendor ID and product ID. |
| ` void` | ` https://developer.android.com/reference/android/hardware/input/InputManager#removePeripheralCustomization(int,%20int,%20android.hardware.input.CustomizationTrigger)(int vendorId, int productId, https://developer.android.com/reference/android/hardware/input/CustomizationTrigger trigger) ` Removes a peripheral customization for a given vendor ID and product ID. |
| ` void` | ` https://developer.android.com/reference/android/hardware/input/InputManager#unregisterInputDeviceListener(android.hardware.input.InputManager.InputDeviceListener)(https://developer.android.com/reference/android/hardware/input/InputManager.InputDeviceListener listener) ` Unregisters an input device listener. |
| ` https://developer.android.com/reference/android/view/VerifiedInputEvent` | ` https://developer.android.com/reference/android/hardware/input/InputManager#verifyInputEvent(android.view.InputEvent)(https://developer.android.com/reference/android/view/InputEvent event) ` Verify the details of an `https://developer.android.com/reference/android/view/InputEvent` that came from the system. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Constants

### ACTION_QUERY_KEYBOARD_LAYOUTS

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

```
public static final String ACTION_QUERY_KEYBOARD_LAYOUTS
```

Broadcast Action: Query available keyboard layouts.


The input manager service locates available keyboard layouts
by querying broadcast receivers that are registered for this action.
An application can offer additional keyboard layouts to the user
by declaring a suitable broadcast receiver in its manifest.


Here is an example broadcast receiver declaration that an application
might include in its AndroidManifest.xml to advertise keyboard layouts.
The meta-data specifies a resource that contains a description of each keyboard
layout that is provided by the application.


     <receiver android:name=".InputDeviceReceiver"
             android:label="@string/keyboard_layouts_label">
         <intent-filter>
             <action android:name="android.hardware.input.action.QUERY_KEYBOARD_LAYOUTS" />
         </intent-filter>
         <meta-data android:name="android.hardware.input.metadata.KEYBOARD_LAYOUTS"
                 android:resource="@xml/keyboard_layouts" />
     </receiver>
     
<br />


In the above example, the `@xml/keyboard_layouts` resource refers to
an XML resource whose root element is `<keyboard-layouts>` that
contains zero or more `<keyboard-layout>` elements.
Each `<keyboard-layout>` element specifies the name, label, and location
of a key character map for a particular keyboard layout. The label on the receiver
is used to name the collection of keyboard layouts provided by this receiver in the
keyboard layout settings.


     <?xml version="1.0" encoding="utf-8"?>
     <keyboard-layouts xmlns:android="http://schemas.android.com/apk/res/android">
         <keyboard-layout android:name="keyboard_layout_english_us"
                 android:label="@string/keyboard_layout_english_us_label"
                 android:keyboardLayout="@raw/keyboard_layout_english_us" />
     </keyboard-layouts>
     
<br />


The `android:name` attribute specifies an identifier by which
the keyboard layout will be known in the package.
The `android:label` attribute specifies a human-readable descriptive
label to describe the keyboard layout in the user interface, such as "English (US)".
The `android:keyboardLayout` attribute refers to a
[key character map](https://source.android.com/docs/core/interaction/input/key-character-map-files) resource that defines the keyboard layout.
The `android:keyboardLocale` attribute specifies a comma separated list of BCP 47
language tags depicting the locales supported by the keyboard layout. This attribute is
optional and will be used for auto layout selection for external physical keyboards.
The `android:keyboardLayoutType` attribute specifies the layoutType for the
keyboard layout. This can be either empty or one of the following supported layout types:
qwerty, qwertz, azerty, dvorak, colemak, workman, extended, turkish_q, turkish_f. This
attribute is optional and will be used for auto layout selection for external physical
keyboards.

<br />

<br />

Constant Value:

"android.hardware.input.action.QUERY_KEYBOARD_LAYOUTS"


### META_DATA_KEYBOARD_LAYOUTS

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

```
public static final String META_DATA_KEYBOARD_LAYOUTS
```

Metadata Key: Keyboard layout metadata associated with
`https://developer.android.com/reference/android/hardware/input/InputManager#ACTION_QUERY_KEYBOARD_LAYOUTS`.


Specifies the resource id of a XML resource that describes the keyboard
layouts that are provided by the application.

<br />

<br />

Constant Value:

"android.hardware.input.metadata.KEYBOARD_LAYOUTS"


## Public methods

### addPeripheralCustomization

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void addPeripheralCustomization (int vendorId, 
                int productId, 
                CustomizationTrigger trigger, 
                CustomizationAction action)
```

Adds a new peripheral customization for a given vendor ID and product ID.


This will remap a key on all connected peripheral devices matching the vendor and product ID
to a different action.


Requires `https://developer.android.com/reference/android/Manifest.permission#MANAGE_PERIPHERAL_CUSTOMIZATION`

<br />

| Parameters ||
|---|---|
| `vendorId` | `int`: the vendor ID of the device <br /> |
| `productId` | `int`: the product ID of the device <br /> |
| `trigger` | `CustomizationTrigger`: the trigger for the customization. This value cannot be `null`. <br /> |
| `action` | `CustomizationAction`: the action to be executed by the trigger. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the `CustomizationTrigger` or `CustomizationAction` is unsupported. |
| `https://developer.android.com/reference/java/lang/IllegalStateException` | if no device with `vendorId` and `productId` is connected. |

### getAllPeripheralCustomizations

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public Map<CustomizationTrigger, CustomizationAction> getAllPeripheralCustomizations (int vendorId, 
                int productId)
```

Retrieves all input customizations for a specific peripheral device.


Requires `https://developer.android.com/reference/android/Manifest.permission#MANAGE_PERIPHERAL_CUSTOMIZATION`

<br />

| Parameters ||
|---|---|
| `vendorId` | `int`: the vendor ID of the device <br /> |
| `productId` | `int`: the product ID of the device <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Map<https://developer.android.com/reference/android/hardware/input/CustomizationTrigger, https://developer.android.com/reference/android/hardware/input/CustomizationAction>` | A map of triggers to actions, or an empty map if none exists. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | if no device with `vendorId` and `productId` is connected. |

### getHostUsiVersion

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

```
public HostUsiVersion getHostUsiVersion (Display display)
```

Reports the version of the Universal Stylus Initiative (USI) protocol supported by the given
display, if any.

<br />

| Parameters ||
|---|---|
| `display` | `Display`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/hardware/input/HostUsiVersion` | the USI version supported by the display, or null if the device does not support USI <br /> |

**See also:**

- [Universal Stylus Initiative](https://universalstylus.org)

### getInputDevice

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

```
public InputDevice getInputDevice (int id)
```

Gets information about the input device with the specified id.

<br />

| Parameters ||
|---|---|
| `id` | `int`: The device id. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/InputDevice` | The input device or null if not found. <br /> |

### getInputDeviceIds

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

```
public int[] getInputDeviceIds ()
```

Gets the ids of all input devices in the system.

<br />

| Returns ||
|---|---|
| `int[]` | The input device ids. <br /> |

### getInputDeviceViewBehavior

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

```
public InputDevice.ViewBehavior getInputDeviceViewBehavior (int deviceId)
```

Gets the `https://developer.android.com/reference/android/view/InputDevice.ViewBehavior` of the input device with a given `id`.

Use this API to query a fresh view behavior instance whenever the input device
changes.

<br />

| Parameters ||
|---|---|
| `deviceId` | `int`: the id of the input device whose view behavior is being requested. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/InputDevice.ViewBehavior` | the view behavior of the input device with the provided id, or `null` if there is not input device with the provided id. <br /> |

### getMaximumObscuringOpacityForTouch

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

```
public float getMaximumObscuringOpacityForTouch ()
```

Returns the maximum allowed obscuring opacity per UID to propagate touches.

For certain window types (eg. `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION_OVERLAY`), the decision
of honoring `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#FLAG_NOT_TOUCHABLE` or not depends on the combined obscuring
opacity of the windows above the touch-consuming window, per UID. Check documentation of
`https://developer.android.com/reference/android/view/WindowManager.LayoutParams#FLAG_NOT_TOUCHABLE` for more details.

The value returned is between 0 (inclusive) and 1 (inclusive).

<br />

| Returns ||
|---|---|
| `float` | Value is between 0.0f and 1.0f inclusive <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#FLAG_NOT_TOUCHABLE`

### getPeripheralCustomization

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public CustomizationAction getPeripheralCustomization (int vendorId, 
                int productId, 
                CustomizationTrigger trigger)
```

Retrieves a specific peripheral customization action for a given trigger.


Requires `https://developer.android.com/reference/android/Manifest.permission#MANAGE_PERIPHERAL_CUSTOMIZATION`

<br />

| Parameters ||
|---|---|
| `vendorId` | `int`: the vendor ID of the device <br /> |
| `productId` | `int`: the product ID of the device <br /> |
| `trigger` | `CustomizationTrigger`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/hardware/input/CustomizationAction` | action or null if none exists. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | if no device with `vendorId` and `productId` is connected. |

### isButtonAllowedForCustomization

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public boolean isButtonAllowedForCustomization (int vendorId, 
                int productId, 
                int buttonCode)
```

Checks if a specific button is allowed for customization on the device(s).


Requires `https://developer.android.com/reference/android/Manifest.permission#MANAGE_PERIPHERAL_CUSTOMIZATION`

<br />

| Parameters ||
|---|---|
| `vendorId` | `int`: the vendor ID of the device. <br /> |
| `productId` | `int`: the product ID of the device. <br /> |
| `buttonCode` | `int`: the button code to check. Value is one of the following: - `https://developer.android.com/reference/android/hardware/input/ButtonCustomizationTrigger#CUSTOMIZABLE_BUTTON_TERTIARY` - `https://developer.android.com/reference/android/hardware/input/ButtonCustomizationTrigger#CUSTOMIZABLE_BUTTON_BACK` - `https://developer.android.com/reference/android/hardware/input/ButtonCustomizationTrigger#CUSTOMIZABLE_BUTTON_FORWARD` - `https://developer.android.com/reference/android/hardware/input/ButtonCustomizationTrigger#CUSTOMIZABLE_BUTTON_EXTRA` - `https://developer.android.com/reference/android/hardware/input/ButtonCustomizationTrigger#CUSTOMIZABLE_BUTTON_SIDE` - `https://developer.android.com/reference/android/hardware/input/ButtonCustomizationTrigger#CUSTOMIZABLE_BUTTON_TASK` |

| Returns ||
|---|---|
| `boolean` | true if the button can be customized on the matching devices, False otherwise. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | if no device with `vendorId` and `productId` is connected. |

### isKeyAllowedForCustomization

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public boolean isKeyAllowedForCustomization (int vendorId, 
                int productId, 
                int keyCode)
```

Gets whether a keycode can be customized on a device.


Requires `https://developer.android.com/reference/android/Manifest.permission#MANAGE_PERIPHERAL_CUSTOMIZATION`

<br />

| Parameters ||
|---|---|
| `vendorId` | `int`: the vendor ID for the device. <br /> |
| `productId` | `int`: the product ID for the device. <br /> |
| `keyCode` | `int`: the android keycode to check. Value is one of the following: - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F1` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F2` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F3` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F4` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F5` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F6` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F7` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F8` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F9` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F10` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F11` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F12` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F13` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F14` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F15` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F16` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F17` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F18` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F19` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F20` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F21` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F22` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F23` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_F24` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_ASSIST` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_BACK` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_BOOKMARK` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_BRIGHTNESS_DOWN` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_BRIGHTNESS_UP` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_CALCULATOR` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_CALENDAR` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_CAMERA` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_CONTACTS` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_DICTATE` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_ENVELOPE` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_EXPLORER` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_FORWARD` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_FULLSCREEN` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_MEDIA_EJECT` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_MEDIA_NEXT` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_MEDIA_PLAY_PAUSE` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_MEDIA_PREVIOUS` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_MEDIA_STOP` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_MENU` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_MOVE_HOME` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_MUSIC` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_NEW` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_SCREENSHOT` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_SEARCH` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_SYSRQ` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_VOLUME_DOWN` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_VOLUME_MUTE` - `https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger#CUSTOMIZABLE_KEYCODE_VOLUME_UP` |

| Returns ||
|---|---|
| `boolean` | true if the keycode can be customized on the device. False otherwise. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | if no device with `vendorId` and `productId` is connected. |

### isStylusPointerIconEnabled

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

```
public boolean isStylusPointerIconEnabled ()
```

Check if showing a `https://developer.android.com/reference/android/view/PointerIcon` for styluses is enabled.

<br />

| Returns ||
|---|---|
| `boolean` | true if a pointer icon will be shown over the location of a stylus pointer, false if there is no pointer icon shown for styluses. <br /> |

### registerInputDeviceListener

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

```
public void registerInputDeviceListener (InputManager.InputDeviceListener listener, 
                Handler handler)
```

Registers an input device listener to receive notifications about when
input devices are added, removed or changed.

<br />

| Parameters ||
|---|---|
| `listener` | `InputManager.InputDeviceListener`: The listener to register. <br /> |
| `handler` | `Handler`: The handler on which the listener should be invoked, or null if the listener should be invoked on the calling thread's looper. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/input/InputManager#unregisterInputDeviceListener(android.hardware.input.InputManager.InputDeviceListener)`

### removeAllPeripheralCustomizations

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void removeAllPeripheralCustomizations (int vendorId, 
                int productId)
```

Remove all peripheral customizations for a given vendor ID and product ID.


This will remove all customizations on all connected peripheral devices matching the
vendor and product ID. If no customizations exist, this method does nothing.


Requires `https://developer.android.com/reference/android/Manifest.permission#MANAGE_PERIPHERAL_CUSTOMIZATION`

<br />

| Parameters ||
|---|---|
| `vendorId` | `int`: the vendor ID of the device <br /> |
| `productId` | `int`: the product ID of the device <br /> |

### removePeripheralCustomization

Added in [version 37.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void removePeripheralCustomization (int vendorId, 
                int productId, 
                CustomizationTrigger trigger)
```

Removes a peripheral customization for a given vendor ID and product ID.


This will remove a specific customization on all connected peripheral devices matching the
vendor and product ID. If the specified customization does not exist,
this method does nothing.


Requires `https://developer.android.com/reference/android/Manifest.permission#MANAGE_PERIPHERAL_CUSTOMIZATION`

<br />

| Parameters ||
|---|---|
| `vendorId` | `int`: the vendor ID of the device <br /> |
| `productId` | `int`: the product ID of the device <br /> |
| `trigger` | `CustomizationTrigger`: the trigger of the customization to remove. This value cannot be `null`. <br /> |

### unregisterInputDeviceListener

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

```
public void unregisterInputDeviceListener (InputManager.InputDeviceListener listener)
```

Unregisters an input device listener.

<br />

| Parameters ||
|---|---|
| `listener` | `InputManager.InputDeviceListener`: The listener to unregister. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/input/InputManager#registerInputDeviceListener(android.hardware.input.InputManager.InputDeviceListener,%20android.os.Handler)`

### verifyInputEvent

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

```
public VerifiedInputEvent verifyInputEvent (InputEvent event)
```

Verify the details of an `https://developer.android.com/reference/android/view/InputEvent` that came from the system.
If the event did not come from the system, or its details could not be verified, then this
will return `null`. Receiving `null` does not mean that the event did not
originate from the system, just that we were unable to verify it. This can
happen for a number of reasons during normal operation.

<br />

| Parameters ||
|---|---|
| `event` | `InputEvent`: The `https://developer.android.com/reference/android/view/InputEvent` to check. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/VerifiedInputEvent` | `https://developer.android.com/reference/android/view/VerifiedInputEvent`, which is a subset of the provided `https://developer.android.com/reference/android/view/InputEvent`, or `null` if the event could not be verified. <br /> |