[ Web Proxy ]
URL:
Viewing: https://developer.android.com/reference/android/hardware/input/KeyCustomizationTrigger [Back]  [Original]

KeyCustomizationTrigger  |  API reference  |  Android Developers Skip to main content
Essentials Design & Plan Develop Google Play Blog
Search:
Android Studio
Android Developers [Android Developers]
Stay organized with collections Save and categorize content based on your preferences.

KeyCustomizationTrigger


public final class KeyCustomizationTrigger
extends CustomizationTrigger

java.lang.Object
   ↳ android.hardware.input.CustomizationTrigger
     ↳ android.hardware.input.KeyCustomizationTrigger


Represents a trigger based on a physical key press on a peripheral.

Summary

Constants

int CUSTOMIZABLE_KEYCODE_ASSIST

Customizable Key code: Assist key.

int CUSTOMIZABLE_KEYCODE_BACK

Customizable Key code: Back key.

int CUSTOMIZABLE_KEYCODE_BOOKMARK

Customizable Key code: Bookmark key.

int CUSTOMIZABLE_KEYCODE_BRIGHTNESS_DOWN

Customizable Key code: Brightness Down key.

int CUSTOMIZABLE_KEYCODE_BRIGHTNESS_UP

Customizable Key code: Brightness Up key.

int CUSTOMIZABLE_KEYCODE_CALCULATOR

Customizable Key code: Calculator key.

int CUSTOMIZABLE_KEYCODE_CALENDAR

Customizable Key code: Calendar key.

int CUSTOMIZABLE_KEYCODE_CAMERA

Customizable Key code: Camera key.

int CUSTOMIZABLE_KEYCODE_CONTACTS

Customizable Key code: Contacts key.

int CUSTOMIZABLE_KEYCODE_DICTATE

Customizable Key code: Dictate key.

int CUSTOMIZABLE_KEYCODE_ENVELOPE

Customizable Key code: Envelope key.

int CUSTOMIZABLE_KEYCODE_EXPLORER

Customizable Key code: Explorer key.

int CUSTOMIZABLE_KEYCODE_F1

Customizable Key code: F1 key.

int CUSTOMIZABLE_KEYCODE_F10

Customizable Key code: F10 key.

int CUSTOMIZABLE_KEYCODE_F11

Customizable Key code: F11 key.

int CUSTOMIZABLE_KEYCODE_F12

Customizable Key code: F12 key.

int CUSTOMIZABLE_KEYCODE_F13

Customizable Key code: F13 key.

int CUSTOMIZABLE_KEYCODE_F14

Customizable Key code: F14 key.

int CUSTOMIZABLE_KEYCODE_F15

Customizable Key code: F15 key.

int CUSTOMIZABLE_KEYCODE_F16

Customizable Key code: F16 key.

int CUSTOMIZABLE_KEYCODE_F17

Customizable Key code: F17 key.

int CUSTOMIZABLE_KEYCODE_F18

Customizable Key code: F18 key.

int CUSTOMIZABLE_KEYCODE_F19

Customizable Key code: F19 key.

int CUSTOMIZABLE_KEYCODE_F2

Customizable Key code: F2 key.

int CUSTOMIZABLE_KEYCODE_F20

Customizable Key code: F20 key.

int CUSTOMIZABLE_KEYCODE_F21

Customizable Key code: F21 key.

int CUSTOMIZABLE_KEYCODE_F22

Customizable Key code: F22 key.

int CUSTOMIZABLE_KEYCODE_F23

Customizable Key code: F23 key.

int CUSTOMIZABLE_KEYCODE_F24

Customizable Key code: F24 key.

int CUSTOMIZABLE_KEYCODE_F3

Customizable Key code: F3 key.

int CUSTOMIZABLE_KEYCODE_F4

Customizable Key code: F4 key.

int CUSTOMIZABLE_KEYCODE_F5

Customizable Key code: F5 key.

int CUSTOMIZABLE_KEYCODE_F6

Customizable Key code: F6 key.

int CUSTOMIZABLE_KEYCODE_F7

Customizable Key code: F7 key.

int CUSTOMIZABLE_KEYCODE_F8

Customizable Key code: F8 key.

int CUSTOMIZABLE_KEYCODE_F9

Customizable Key code: F9 key.

int CUSTOMIZABLE_KEYCODE_FORWARD

Customizable Key code: Forward key.

int CUSTOMIZABLE_KEYCODE_FULLSCREEN

Customizable Key code: Full Screen key.

int CUSTOMIZABLE_KEYCODE_MEDIA_EJECT

Customizable Key code: Eject key.

int CUSTOMIZABLE_KEYCODE_MEDIA_NEXT

Customizable Key code: Next Media key.

int CUSTOMIZABLE_KEYCODE_MEDIA_PLAY_PAUSE

Customizable Key code: Play/Pause Media key.

int CUSTOMIZABLE_KEYCODE_MEDIA_PREVIOUS

Customizable Key code: Previous Media key.

int CUSTOMIZABLE_KEYCODE_MEDIA_STOP

Customizable Key code: Stop Media key.

int CUSTOMIZABLE_KEYCODE_MENU

Customizable Key code: Menu key.

int CUSTOMIZABLE_KEYCODE_MOVE_HOME

Customizable Key code: Home key.

int CUSTOMIZABLE_KEYCODE_MUSIC

Customizable Key code: Music key.

int CUSTOMIZABLE_KEYCODE_NEW

Customizable Key code: New key.

int CUSTOMIZABLE_KEYCODE_SCREENSHOT

Customizable Key code: Screenshot key.

int CUSTOMIZABLE_KEYCODE_SEARCH

Customizable Key code: Search key.

int CUSTOMIZABLE_KEYCODE_SYSRQ

Customizable Key code: System Request / Print Screen key.

int CUSTOMIZABLE_KEYCODE_VOLUME_DOWN

Customizable Key code: Volume Down key.

int CUSTOMIZABLE_KEYCODE_VOLUME_MUTE

Customizable Key code: Volume Mute key.

int CUSTOMIZABLE_KEYCODE_VOLUME_UP

Customizable Key code: Volume Up key.

Public constructors

KeyCustomizationTrigger(int keyCode)

Creates a Trigger for a specific key code.

Public methods

int getKeyCode()

Returns the key code associated with this trigger.

String toString()

Returns a string representation of the object.

Inherited methods

Constants

CUSTOMIZABLE_KEYCODE_ASSIST

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_ASSIST

Customizable Key code: Assist key.

Constant Value: 219 (0x000000db)

CUSTOMIZABLE_KEYCODE_BACK

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_BACK

Customizable Key code: Back key.

Constant Value: 4 (0x00000004)

CUSTOMIZABLE_KEYCODE_BOOKMARK

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_BOOKMARK

Customizable Key code: Bookmark key.

Constant Value: 174 (0x000000ae)

CUSTOMIZABLE_KEYCODE_BRIGHTNESS_DOWN

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_BRIGHTNESS_DOWN

Customizable Key code: Brightness Down key.

Constant Value: 220 (0x000000dc)

CUSTOMIZABLE_KEYCODE_BRIGHTNESS_UP

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_BRIGHTNESS_UP

Customizable Key code: Brightness Up key.

Constant Value: 221 (0x000000dd)

CUSTOMIZABLE_KEYCODE_CALCULATOR

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_CALCULATOR

Customizable Key code: Calculator key.

Constant Value: 210 (0x000000d2)

CUSTOMIZABLE_KEYCODE_CALENDAR

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_CALENDAR

Customizable Key code: Calendar key.

Constant Value: 208 (0x000000d0)

CUSTOMIZABLE_KEYCODE_CAMERA

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_CAMERA

Customizable Key code: Camera key.

Constant Value: 27 (0x0000001b)

CUSTOMIZABLE_KEYCODE_CONTACTS

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_CONTACTS

Customizable Key code: Contacts key.

Constant Value: 207 (0x000000cf)

CUSTOMIZABLE_KEYCODE_DICTATE

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_DICTATE

Customizable Key code: Dictate key.

Constant Value: 319 (0x0000013f)

CUSTOMIZABLE_KEYCODE_ENVELOPE

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_ENVELOPE

Customizable Key code: Envelope key.

Constant Value: 65 (0x00000041)

CUSTOMIZABLE_KEYCODE_EXPLORER

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_EXPLORER

Customizable Key code: Explorer key.

Constant Value: 64 (0x00000040)

CUSTOMIZABLE_KEYCODE_F1

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F1

Customizable Key code: F1 key.

Constant Value: 131 (0x00000083)

CUSTOMIZABLE_KEYCODE_F10

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F10

Customizable Key code: F10 key.

Constant Value: 140 (0x0000008c)

CUSTOMIZABLE_KEYCODE_F11

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F11

Customizable Key code: F11 key.

Constant Value: 141 (0x0000008d)

CUSTOMIZABLE_KEYCODE_F12

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F12

Customizable Key code: F12 key.

Constant Value: 142 (0x0000008e)

CUSTOMIZABLE_KEYCODE_F13

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F13

Customizable Key code: F13 key.

Constant Value: 326 (0x00000146)

CUSTOMIZABLE_KEYCODE_F14

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F14

Customizable Key code: F14 key.

Constant Value: 327 (0x00000147)

CUSTOMIZABLE_KEYCODE_F15

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F15

Customizable Key code: F15 key.

Constant Value: 328 (0x00000148)

CUSTOMIZABLE_KEYCODE_F16

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F16

Customizable Key code: F16 key.

Constant Value: 329 (0x00000149)

CUSTOMIZABLE_KEYCODE_F17

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F17

Customizable Key code: F17 key.

Constant Value: 330 (0x0000014a)

CUSTOMIZABLE_KEYCODE_F18

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F18

Customizable Key code: F18 key.

Constant Value: 331 (0x0000014b)

CUSTOMIZABLE_KEYCODE_F19

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F19

Customizable Key code: F19 key.

Constant Value: 332 (0x0000014c)

CUSTOMIZABLE_KEYCODE_F2

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F2

Customizable Key code: F2 key.

Constant Value: 132 (0x00000084)

CUSTOMIZABLE_KEYCODE_F20

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F20

Customizable Key code: F20 key.

Constant Value: 333 (0x0000014d)

CUSTOMIZABLE_KEYCODE_F21

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F21

Customizable Key code: F21 key.

Constant Value: 334 (0x0000014e)

CUSTOMIZABLE_KEYCODE_F22

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F22

Customizable Key code: F22 key.

Constant Value: 335 (0x0000014f)

CUSTOMIZABLE_KEYCODE_F23

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F23

Customizable Key code: F23 key.

Constant Value: 336 (0x00000150)

CUSTOMIZABLE_KEYCODE_F24

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F24

Customizable Key code: F24 key.

Constant Value: 337 (0x00000151)

CUSTOMIZABLE_KEYCODE_F3

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F3

Customizable Key code: F3 key.

Constant Value: 133 (0x00000085)

CUSTOMIZABLE_KEYCODE_F4

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F4

Customizable Key code: F4 key.

Constant Value: 134 (0x00000086)

CUSTOMIZABLE_KEYCODE_F5

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F5

Customizable Key code: F5 key.

Constant Value: 135 (0x00000087)

CUSTOMIZABLE_KEYCODE_F6

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F6

Customizable Key code: F6 key.

Constant Value: 136 (0x00000088)

CUSTOMIZABLE_KEYCODE_F7

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F7

Customizable Key code: F7 key.

Constant Value: 137 (0x00000089)

CUSTOMIZABLE_KEYCODE_F8

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F8

Customizable Key code: F8 key.

Constant Value: 138 (0x0000008a)

CUSTOMIZABLE_KEYCODE_F9

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_F9

Customizable Key code: F9 key.

Constant Value: 139 (0x0000008b)

CUSTOMIZABLE_KEYCODE_FORWARD

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_FORWARD

Customizable Key code: Forward key.

Constant Value: 125 (0x0000007d)

CUSTOMIZABLE_KEYCODE_FULLSCREEN

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_FULLSCREEN

Customizable Key code: Full Screen key.

Constant Value: 325 (0x00000145)

CUSTOMIZABLE_KEYCODE_MEDIA_EJECT

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_MEDIA_EJECT

Customizable Key code: Eject key.

Constant Value: 129 (0x00000081)

CUSTOMIZABLE_KEYCODE_MEDIA_NEXT

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_MEDIA_NEXT

Customizable Key code: Next Media key.

Constant Value: 87 (0x00000057)

CUSTOMIZABLE_KEYCODE_MEDIA_PLAY_PAUSE

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_MEDIA_PLAY_PAUSE

Customizable Key code: Play/Pause Media key.

Constant Value: 85 (0x00000055)

CUSTOMIZABLE_KEYCODE_MEDIA_PREVIOUS

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_MEDIA_PREVIOUS

Customizable Key code: Previous Media key.

Constant Value: 88 (0x00000058)

CUSTOMIZABLE_KEYCODE_MEDIA_STOP

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_MEDIA_STOP

Customizable Key code: Stop Media key.

Constant Value: 86 (0x00000056)

CUSTOMIZABLE_KEYCODE_MENU

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_MENU

Customizable Key code: Menu key.

Constant Value: 82 (0x00000052)

CUSTOMIZABLE_KEYCODE_MOVE_HOME

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_MOVE_HOME

Customizable Key code: Home key.

Constant Value: 122 (0x0000007a)

CUSTOMIZABLE_KEYCODE_MUSIC

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_MUSIC

Customizable Key code: Music key.

Constant Value: 209 (0x000000d1)

CUSTOMIZABLE_KEYCODE_NEW

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_NEW

Customizable Key code: New key.

Constant Value: 320 (0x00000140)

CUSTOMIZABLE_KEYCODE_SCREENSHOT

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_SCREENSHOT

Customizable Key code: Screenshot key.

Constant Value: 318 (0x0000013e)

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_SEARCH

Customizable Key code: Search key.

Constant Value: 84 (0x00000054)

CUSTOMIZABLE_KEYCODE_SYSRQ

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_SYSRQ

Customizable Key code: System Request / Print Screen key.

Constant Value: 120 (0x00000078)

CUSTOMIZABLE_KEYCODE_VOLUME_DOWN

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_VOLUME_DOWN

Customizable Key code: Volume Down key.

Constant Value: 25 (0x00000019)

CUSTOMIZABLE_KEYCODE_VOLUME_MUTE

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_VOLUME_MUTE

Customizable Key code: Volume Mute key.

Constant Value: 164 (0x000000a4)

CUSTOMIZABLE_KEYCODE_VOLUME_UP

Added in version 37.1
public static final int CUSTOMIZABLE_KEYCODE_VOLUME_UP

Customizable Key code: Volume Up key.

Constant Value: 24 (0x00000018)

Public constructors

KeyCustomizationTrigger

Added in version 37.1
public KeyCustomizationTrigger (int keyCode)

Creates a Trigger for a specific key code.

Parameters
keyCode int: The key code for the trigger. Must be a ERROR(CustomizableKeyCode/android.hardware.input.KeyCustomizationTrigger.CustomizableKeyCode CustomizableKeyCode).
Value is one of the following:

Public methods

getKeyCode

Added in version 37.1
public int getKeyCode ()

Returns the key code associated with this trigger.

Returns
int Value is one of the following:

toString

Added in version 37.1
public String toString ()

Returns a string representation of the object.

Returns
String a string representation of the object.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-08-03 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-03 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page