Added in API level 1

KeyEvent


open class KeyEvent : InputEvent, Parcelable
kotlin.Any
   ↳ android.view.InputEvent
   ↳ android.view.KeyEvent

Object used to report key and button events.

Each key press is described by a sequence of key events. A key press starts with a key event with ACTION_DOWN. If the key is held sufficiently long that it repeats, then the initial down is followed additional key events with ACTION_DOWN and a non-zero value for getRepeatCount(). The last key event is a ACTION_UP for the key up. If the key press is canceled, the key up event will have the FLAG_CANCELED flag set.

Key events are generally accompanied by a key code (getKeyCode()), scan code (getScanCode()) and meta state (getMetaState()). Key code constants are defined in this class. Scan code constants are raw device-specific codes obtained from the OS and so are not generally meaningful to applications unless interpreted using the KeyCharacterMap. Meta states describe the pressed state of key modifiers such as META_SHIFT_ON or META_ALT_ON.

Key codes typically correspond one-to-one with individual keys on an input device. Many keys and key combinations serve quite different functions on different input devices so care must be taken when interpreting them. Always use the KeyCharacterMap associated with the input device when mapping keys to characters. Be aware that there may be multiple key input devices active at the same time and each will have its own key character map.

As soft input methods can use multiple and inventive ways of inputting text, there is no guarantee that any key press on a soft keyboard will generate a key event: this is left to the IME's discretion, and in fact sending such events is discouraged. You should never rely on receiving KeyEvents for any key on a soft input method. In particular, the default software keyboard will never send any key event to any application targetting Jelly Bean or later, and will only send events for some presses of the delete and return keys to applications targetting Ice Cream Sandwich or earlier. Be aware that other software input methods may never send key events regardless of the version. Consider using editor actions like android.view.inputmethod.EditorInfo#IME_ACTION_DONE if you need specific interaction with the software keyboard, as it gives more visibility to the user as to how your application will react to key presses.

In general, the framework cannot guarantee that the key events it delivers to a view always constitute complete key sequences since some events may be dropped or modified by containing views before they are delivered. The view implementation should be prepared to handle FLAG_CANCELED and should tolerate anomalous situations such as receiving a new ACTION_DOWN without first having received an ACTION_UP for the prior key press.

Refer to InputDevice for more information about how different kinds of input devices and sources represent keys and buttons.

Summary

Nested classes
abstract

open

Use with KeyEvent.dispatch(Callback,DispatcherState,Object) for more advanced key dispatching, such as long presses.

Constants
static Int

getAction value: the key has been pressed down.

static Int

static Int

getAction value: the key has been released.

static Int

When associated with up key events, this indicates that the key press has been canceled.

static Int

Set when a key event has FLAG_CANCELED set because a long press action was executed while it was down.

static Int

This mask is used for compatibility, to identify enter keys that are coming from an IME whose enter key has been auto-labelled "next" or "done".

static Int

Set when a key event has been synthesized to implement default behavior for an event that the application did not handle.

static Int

This mask is set if an event was known to come from a trusted part of the system.

static Int

This mask is set if we don't want the key event to cause us to leave touch mode.

static Int

This flag is set for the first key repeat that occurs after the long press timeout.

static Int

This mask is set if the key event was generated by a software keyboard.

static Int

Set for ACTION_UP when this event's key code is still being tracked from its initial down.

static Int

This key event was generated by a virtual (on-screen) hard key area.

static Int

This mask is set if the device woke because of this key event.

static Int

Key code constant: '0' key.

static Int

Key code constant: '1' key.

static Int

Key code constant: '11' key.

static Int

Key code constant: '12' key.

static Int

Key code constant: '2' key.

static Int

Key code constant: '3' key.

static Int

Key code constant: 3D Mode key.

static Int

Key code constant: '4' key.

static Int

Key code constant: '5' key.

static Int

Key code constant: '6' key.

static Int

Key code constant: '7' key.

static Int

Key code constant: '8' key.

static Int

Key code constant: '9' key.

static Int

Key code constant: 'A' key.

static Int

Key code constant: System Accessibility key.

static Int

Key code constant: Show all apps.

static Int

Key code constant: Left Alt modifier key.

static Int

Key code constant: Right Alt modifier key.

static Int

Key code constant: ''' (apostrophe) key.

static Int

Key code constant: App switch key.

static Int

Key code constant: Assist key.

static Int

Key code constant: '@' key.

static Int

Key code constant: A/V Receiver input key.

static Int

Key code constant: A/V Receiver power key.

static Int

Key code constant: 'B' key.

static Int

Key code constant: Back key.

static Int

Key code constant: '\' key.

static Int

Key code constant: Bookmark key.

static Int

Key code constant: Break / Pause key.

static Int

Key code constant: Brightness Down key.

static Int

Key code constant: Brightness Up key.

static Int

Key code constant: Generic Game Pad Button #1.

static Int

Key code constant: Generic Game Pad Button #10.

static Int

Key code constant: Generic Game Pad Button #11.

static Int

Key code constant: Generic Game Pad Button #12.

static Int

Key code constant: Generic Game Pad Button #13.

static Int

Key code constant: Generic Game Pad Button #14.

static Int

Key code constant: Generic Game Pad Button #15.

static Int

Key code constant: Generic Game Pad Button #16.

static Int

Key code constant: Generic Game Pad Button #2.

static Int

Key code constant: Generic Game Pad Button #3.

static Int

Key code constant: Generic Game Pad Button #4.

static Int

Key code constant: Generic Game Pad Button #5.

static Int

Key code constant: Generic Game Pad Button #6.

static Int

Key code constant: Generic Game Pad Button #7.

static Int

Key code constant: Generic Game Pad Button #8.

static Int

Key code constant: Generic Game Pad Button #9.

static Int

Key code constant: A Button key.

static Int

Key code constant: B Button key.

static Int

Key code constant: C Button key.

static Int

Key code constant: L1 Button key.

static Int

Key code constant: L2 Button key.

static Int

Key code constant: Mode Button key.

static Int

Key code constant: R1 Button key.

static Int

Key code constant: R2 Button key.

static Int

Key code constant: Select Button key.

static Int

Key code constant: Start Button key.

static Int

Key code constant: Left Thumb Button key.

static Int

Key code constant: Right Thumb Button key.

static Int

Key code constant: X Button key.

static Int

Key code constant: Y Button key.

static Int

Key code constant: Z Button key.

static Int

Key code constant: 'C' key.

static Int

Key code constant: Calculator special function key.

static Int

Key code constant: Calendar special function key.

static Int

Key code constant: Call key.

static Int

Key code constant: Camera key.

static Int

Key code constant: Caps Lock key.

static Int

Key code constant: Toggle captions key.

static Int

Key code constant: Channel down key.

static Int

Key code constant: Channel up key.

static Int

Key code constant: Clear key.

static Int

Key code constant: AC Close.

static Int

Key code constant: ',' key.

static Int

Key code constant: Contacts special function key.

static Int

Key code constant: Contextual Insert key.

static Int

Key code constant: Contextual Query key.

static Int

Key code constant: Contextual Search key.

static Int

Key code constant: Copy key.

static Int

Key code constant: Left Control modifier key.

static Int

Key code constant: Right Control modifier key.

static Int

Key code constant: Cut key.

static Int

Key code constant: 'D' key.

static Int

Key code constant: Backspace key.

static Int

Key code constant: Demo Application key #1.

static Int

Key code constant: Demo Application key #2.

static Int

Key code constant: Demo Application key #3.

static Int

Key code constant: Demo Application key #4.

static Int

Key code constant: To start dictate to an input field

static Int

Key code constant: To toggle 'Do Not Disturb' mode.

static Int

Key code constant: Directional Pad Center key.

static Int

Key code constant: Directional Pad Down key.

static Int

Key code constant: Directional Pad Down-Left.

static Int

Key code constant: Directional Pad Down-Right.

static Int

Key code constant: Directional Pad Left key.

static Int

Key code constant: Directional Pad Right key.

static Int

Key code constant: Directional Pad Up key.

static Int

Key code constant: Directional Pad Up-Left.

static Int

Key code constant: Directional Pad Up-Right.

static Int

Key code constant: DVR key.

static Int

Key code constant: 'E' key.

static Int

Key code constant: Japanese alphanumeric key.

static Int

Key code constant: To open emoji picker.

static Int

Key code constant: End Call key.

static Int

Key code constant: Enter key.

static Int

Key code constant: Envelope special function key.

static Int

Key code constant: '=' key.

static Int

Key code constant: Escape key.

static Int

Key code constant: Explorer special function key.

static Int

Key code constant: 'F' key.

static Int

Key code constant: F1 key.

static Int

Key code constant: F10 key.

static Int

Key code constant: F11 key.

static Int

Key code constant: F12 key.

static Int

Key code constant: F13 key.

static Int

Key code constant: F14 key.

static Int

Key code constant: F15 key.

static Int

Key code constant: F16 key.

static Int

Key code constant: F17 key.

static Int

Key code constant: F18 key.

static Int

Key code constant: F19 key.

static Int

Key code constant: F2 key.

static Int

Key code constant: F20 key.

static Int

Key code constant: F21 key.

static Int

Key code constant: F22 key.

static Int

Key code constant: F23 key.

static Int

Key code constant: F24 key.

static Int

Key code constant: F3 key.

static Int

Key code constant: F4 key.

static Int

Key code constant: F5 key.

static Int

Key code constant: F6 key.

static Int

Key code constant: F7 key.

static Int

Key code constant: F8 key.

static Int

Key code constant: F9 key.

static Int

Key code constant: Featured Application key #1.

static Int

Key code constant: Featured Application key #2.

static Int

Key code constant: Featured Application key #3.

static Int

Key code constant: Featured Application key #4.

static Int

Key code constant: Camera Focus key.

static Int

Key code constant: Forward key.

static Int

Key code constant: Forward Delete key.

static Int

Key code constant: To toggle fullscreen mode (on the current application).

static Int

Key code constant: Function modifier key.

static Int

Key code constant: 'G' key.

static Int

Key code constant: '`' (backtick) key.

static Int

Key code constant: Guide key.

static Int

Key code constant: 'H' key.

static Int

Key code constant: Headset Hook key.

static Int

Key code constant: Help key.

static Int

Key code constant: Japanese conversion key.

static Int

Key code constant: Home key.

static Int

Key code constant: 'I' key.

static Int

Key code constant: Info key.

static Int

Key code constant: Insert key.

static Int

Key code constant: 'J' key.

static Int

Key code constant: 'K' key.

static Int

Key code constant: Japanese kana key.

static Int

Key code constant: Japanese katakana / hiragana key.

static Int

Key code constant: Keyboard backlight down.

static Int

Key code constant: Keyboard backlight toggle.

static Int

Key code constant: Keyboard backlight up.

static Int

Key code constant: 'L' key.

static Int

Key code constant: Language Switch key.

static Int

Key code constant: Last Channel key.

static Int

Key code constant: '[' key.

static Int

Key code constant: To lock the screen.

static Int

Key code constant: 'M' key.

static Int

Key code constant: A button whose usage can be customized by the user through the system.

static Int

Key code constant: A button whose usage can be customized by the user through the system.

static Int

Key code constant: A button whose usage can be customized by the user through the system.

static Int

Key code constant: A button whose usage can be customized by the user through the system.

static Int

Key code constant: Manner Mode key.

static Int

Key code constant: Audio Track key.

static Int

Key code constant: Close media key.

static Int

Key code constant: Eject media key.

static Int

Key code constant: Fast Forward media key.

static Int

Key code constant: Play Next media key.

static Int

Key code constant: Pause media key.

static Int

Key code constant: Play media key.

static Int

Key code constant: Play/Pause media key.

static Int

Key code constant: Play Previous media key.

static Int

Key code constant: Record media key.

static Int

Key code constant: Rewind media key.

static Int

Key code constant: Skip backward media key.

static Int

Key code constant: Skip forward media key.

static Int

Key code constant: Step backward media key.

static Int

Key code constant: Step forward media key.

static Int

Key code constant: Stop media key.

static Int

Key code constant: Media Top Menu key.

static Int

Key code constant: Menu key.

static Int

Key code constant: Left Meta modifier key.

static Int

Key code constant: Right Meta modifier key.

static Int

Key code constant: '-'.

static Int

Key code constant: End Movement key.

static Int

Key code constant: Home Movement key.

static Int

Key code constant: Japanese non-conversion key.

static Int

Key code constant: Music special function key.

static Int

Key code constant: Mute key.

static Int

Key code constant: 'N' key.

static Int

Key code constant: Navigate in key.

static Int

Key code constant: Navigate to next key.

static Int

Key code constant: Navigate out key.

static Int

Key code constant: Navigate to previous key.

static Int

Key code constant: AC New.

static Int

Key code constant: Notification key.

static Int

Key code constant: Number modifier key.

static Int

Key code constant: Numeric keypad '0' key.

static Int

Key code constant: Numeric keypad '1' key.

static Int

Key code constant: Numeric keypad '2' key.

static Int

Key code constant: Numeric keypad '3' key.

static Int

Key code constant: Numeric keypad '4' key.

static Int

Key code constant: Numeric keypad '5' key.

static Int

Key code constant: Numeric keypad '6' key.

static Int

Key code constant: Numeric keypad '7' key.

static Int

Key code constant: Numeric keypad '8' key.

static Int

Key code constant: Numeric keypad '9' key.

static Int

Key code constant: Numeric keypad '+' key (for addition).

static Int

Key code constant: Numeric keypad ',' key (for decimals or digit grouping).

static Int

Key code constant: Numeric keypad '/' key (for division).

static Int

Key code constant: Numeric keypad '.

static Int

Key code constant: Numeric keypad Enter key.

static Int

Key code constant: Numeric keypad '=' key.

static Int

Key code constant: Numeric keypad '(' key.

static Int

Key code constant: Numeric keypad '*' key (for multiplication).

static Int

Key code constant: Numeric keypad ')' key.

static Int

Key code constant: Numeric keypad '-' key (for subtraction).

static Int

Key code constant: Num Lock key.

static Int

Key code constant: 'O' key.

static Int

Key code constant: 'P' key.

static Int

Key code constant: Page Down key.

static Int

Key code constant: Page Up key.

static Int

Key code constant: Pairing key.

static Int

Key code constant: Paste key.

static Int

Key code constant: '.

static Int

Key code constant: Picture Symbols modifier key.

static Int

Key code constant: '+' key.

static Int

Key code constant: '#' key.

static Int

Key code constant: Power key.

static Int

Key code constant: To print.

static Int

Key code constant: Used to switch current android.accounts.Account that is consuming content.

static Int

Key code constant: Blue "programmable" key.

static Int

Key code constant: Green "programmable" key.

static Int

Key code constant: Red "programmable" key.

static Int

Key code constant: Yellow "programmable" key.

static Int

Key code constant: 'Q' key.

static Int

Key code constant: 'R' key.

static Int

Key code constant: To open recent apps view (a.k.a. Overview).

static Int

Key code constant: Refresh key.

static Int

Key code constant: ']' key.

static Int

Key code constant: Japanese Ro key.

static Int

Key code constant: 'S' key.

static Int

Key code constant: To take a screenshot.

static Int

Key code constant: Scroll Lock key.

static Int

Key code constant: Search key.

static Int

Key code constant: ';' key.

static Int

Key code constant: Settings key.

static Int

Key code constant: Left Shift modifier key.

static Int

Key code constant: Right Shift modifier key.

static Int

Key code constant: '/' key.

static Int

Key code constant: Sleep key.

static Int

Key code constant: Soft Left key.

static Int

Key code constant: Soft Right key.

static Int

Key code constant: Put device to sleep unless a wakelock is held.

static Int

Key code constant: Space key.

static Int

Key code constant: '*' key.

static Int

Key code constant: Set-top-box input key.

static Int

Key code constant: Set-top-box power key.

static Int

Key code constant: Generic stem key 1 for Wear.

static Int

Key code constant: Generic stem key 2 for Wear.

static Int

Key code constant: Generic stem key 3 for Wear.

static Int

Key code constant: Primary stem key for Wear.

static Int

Key code constant: The primary button on the barrel of a stylus.

static Int

Key code constant: The secondary button on the barrel of a stylus.

static Int

Key code constant: A button on the tail end of a stylus.

static Int

Key code constant: The tertiary button on the barrel of a stylus.

static Int

Key code constant: Switch Charset modifier key.

static Int

Key code constant: Symbol modifier key.

static Int

Key code constant: System Request / Print Screen key.

static Int

Key code constant: Consumed by the system for navigation down.

static Int

Key code constant: Consumed by the system for navigation left.

static Int

Key code constant: Consumed by the system for navigation right.

static Int

Key code constant: Consumed by the system for navigation up.

static Int

Key code constant: 'T' key.

static Int

Key code constant: Tab key.

static Int

Key code constant: Thumbs down key.

static Int

Key code constant: Thumbs up key.

static Int

Key code constant: TV key.

static Int

Key code constant: Antenna/Cable key.

static Int

Key code constant: Audio description key.

static Int

Key code constant: Audio description mixing volume down key.

static Int

Key code constant: Audio description mixing volume up key.

static Int

Key code constant: Contents menu key.

static Int

Key code constant: TV data service key.

static Int

Key code constant: TV input key.

static Int

Key code constant: Component #1 key.

static Int

Key code constant: Component #2 key.

static Int

Key code constant: Composite #1 key.

static Int

Key code constant: Composite #2 key.

static Int

Key code constant: HDMI #1 key.

static Int

Key code constant: HDMI #2 key.

static Int

Key code constant: HDMI #3 key.

static Int

Key code constant: HDMI #4 key.

static Int

Key code constant: VGA #1 key.

static Int

Key code constant: Media context menu key.

static Int

Key code constant: Toggle Network key.

static Int

Key code constant: Number entry key.

static Int

Key code constant: TV power key.

static Int

Key code constant: Radio key.

static Int

Key code constant: Satellite key.

static Int

Key code constant: BS key.

static Int

Key code constant: CS key.

static Int

Key code constant: BS/CS key.

static Int

Key code constant: Teletext key.

static Int

Key code constant: Analog Terrestrial key.

static Int

Key code constant: Digital Terrestrial key.

static Int

Key code constant: Timer programming key.

static Int

Key code constant: Zoom mode key.

static Int

Key code constant: 'U' key.

static Int

Key code constant: Unknown key code.

static Int

Key code constant: 'V' key.

static Int

Key code constant: Video Application key #1.

static Int

Key code constant: Video Application key #2.

static Int

Key code constant: Video Application key #3.

static Int

Key code constant: Video Application key #4.

static Int

Key code constant: Video Application key #5.

static Int

Key code constant: Video Application key #6.

static Int

Key code constant: Video Application key #7.

static Int

Key code constant: Video Application key #8.

static Int

Key code constant: Voice Assist key.

static Int

Key code constant: Volume Down key.

static Int

Key code constant: Volume Mute key.

static Int

Key code constant: Volume Up key.

static Int

Key code constant: 'W' key.

static Int

Key code constant: Wakeup key.

static Int

Key code constant: Window key.

static Int

Key code constant: 'X' key.

static Int

Key code constant: 'Y' key.

static Int

Key code constant: Japanese Yen key.

static Int

Key code constant: 'Z' key.

static Int

Key code constant: Japanese full-width / half-width key.

static Int

Key code constant: Zoom in key.

static Int

Key code constant: Zoom out key.

static Int

static Int

This mask is used to check whether the left ALT meta key is pressed.

static Int

This mask is a combination of META_ALT_ON, META_ALT_LEFT_ON and META_ALT_RIGHT_ON.

static Int

This mask is used to check whether one of the ALT meta keys is pressed.

static Int

This mask is used to check whether the right the ALT meta key is pressed.

static Int

This mask is used to check whether the CAPS LOCK meta key is on.

static Int

This mask is used to check whether the left CTRL meta key is pressed.

static Int

This mask is a combination of META_CTRL_ON, META_CTRL_LEFT_ON and META_CTRL_RIGHT_ON.

static Int

This mask is used to check whether one of the CTRL meta keys is pressed.

static Int

This mask is used to check whether the right CTRL meta key is pressed.

static Int

This mask is used to check whether the FUNCTION meta key is pressed.

static Int

This mask is used to check whether the left META meta key is pressed.

static Int

This mask is a combination of META_META_ON, META_META_LEFT_ON and META_META_RIGHT_ON.

static Int

This mask is used to check whether one of the META meta keys is pressed.

static Int

This mask is used to check whether the right META meta key is pressed.

static Int

This mask is used to check whether the NUM LOCK meta key is on.

static Int

This mask is used to check whether the SCROLL LOCK meta key is on.

static Int

This mask is used to check whether the left SHIFT meta key is pressed.

static Int

This mask is a combination of META_SHIFT_ON, META_SHIFT_LEFT_ON and META_SHIFT_RIGHT_ON.

static Int

This mask is used to check whether one of the SHIFT meta keys is pressed.

static Int

This mask is used to check whether the right SHIFT meta key is pressed.

static Int

This mask is used to check whether the SYM meta key is pressed.

Inherited constants
Public constructors
KeyEvent(origEvent: KeyEvent!)

Make an exact copy of an existing key event.

KeyEvent(origEvent: KeyEvent!, eventTime: Long, newRepeat: Int)

Copy an existing key event, modifying its time and repeat count.

KeyEvent(action: Int, code: Int)

Create a new key event.

KeyEvent(time: Long, characters: String!, deviceId: Int, flags: Int)

Create a new key event for a string of characters.

KeyEvent(downTime: Long, eventTime: Long, action: Int, code: Int, repeat: Int)

Create a new key event.

KeyEvent(downTime: Long, eventTime: Long, action: Int, code: Int, repeat: Int, metaState: Int)

Create a new key event.

KeyEvent(downTime: Long, eventTime: Long, action: Int, code: Int, repeat: Int, metaState: Int, deviceId: Int, scancode: Int)

Create a new key event.

KeyEvent(downTime: Long, eventTime: Long, action: Int, code: Int, repeat: Int, metaState: Int, deviceId: Int, scancode: Int, flags: Int)

Create a new key event.

KeyEvent(downTime: Long, eventTime: Long, action: Int, code: Int, repeat: Int, metaState: Int, deviceId: Int, scancode: Int, flags: Int, source: Int)

Create a new key event.

Public methods
open static KeyEvent!
changeAction(event: KeyEvent!, action: Int)

Create a new key event that is the same as the given one, but whose action is replaced with the given value.

open static KeyEvent!
changeFlags(event: KeyEvent!, flags: Int)

Create a new key event that is the same as the given one, but whose flags are replaced with the given value.

open static KeyEvent!
changeTimeRepeat(event: KeyEvent!, eventTime: Long, newRepeat: Int)

Create a new key event that is the same as the given one, but whose event time and repeat count are replaced with the given value.

open static KeyEvent!
changeTimeRepeat(event: KeyEvent!, eventTime: Long, newRepeat: Int, newFlags: Int)

Create a new key event that is the same as the given one, but whose event time and repeat count are replaced with the given value.

Boolean

Boolean
dispatch(receiver: KeyEvent.Callback!, state: KeyEvent.DispatcherState!, target: Any!)

Deliver this key event to a Callback interface.

Int

Retrieve the action of this key event.

String!

For the special case of a ACTION_MULTIPLE event with key code of KEYCODE_UNKNOWN, this is a raw string of characters associated with the event.

open static Int
getDeadChar(accent: Int, c: Int)

Get the character that is produced by putting accent on the character c.

Int

Gets the id for the device that this event came from.

open Char

Gets the primary character for this key.

Long

Retrieve the time of the most recent key down event, in the android.os.SystemClock#uptimeMillis time base.

Long

Retrieve the time this event occurred, in the android.os.SystemClock#uptimeMillis time base.

Int

Returns the flags for this key event.

KeyCharacterMap!

Gets the KeyCharacterMap associated with the keyboard device.

Int

Retrieve the key code of the key event.

open Boolean

Get the character conversion data for a given key code.

open Char

Gets the first character in the character array that can be generated by the specified key code.

open Char
getMatch(chars: CharArray!, metaState: Int)

Gets the first character in the character array that can be generated by the specified key code.

open static Int

Returns the maximum keycode.

Int

Returns the state of the meta keys.

open static Int

Gets a mask that includes all valid modifier key meta state bits.

Int

Returns the state of the modifier keys.

open Char

Gets the number or symbol associated with the key.

Int

Retrieve the repeat count of the event.

Int

Retrieve the hardware key id of this key event.

Int

Gets the source of the event.

open Int

Gets the Unicode character generated by the specified key and meta key state combination.

open Int
getUnicodeChar(metaState: Int)

Gets the Unicode character generated by the specified key and meta key state combination.

Boolean
hasModifiers(modifiers: Int)

Returns true if only the specified modifiers keys are pressed.

Boolean

Returns true if no modifier keys are pressed.

Boolean

Returns the pressed state of the ALT meta key.

Boolean

For ACTION_UP events, indicates that the event has been canceled as per FLAG_CANCELED.

Boolean

Returns the locked state of the CAPS LOCK meta key.

Boolean

Returns the pressed state of the CTRL meta key.

Boolean

Returns the pressed state of the FUNCTION meta key.

static Boolean
isGamepadButton(keyCode: Int)

Returns true if the specified keycode is a gamepad button.

Boolean

For ACTION_DOWN events, indicates that the event has been canceled as per FLAG_LONG_PRESS.

static Boolean

Returns whether this key will be sent to the android.media.session.MediaSession.Callback if not handled.

Boolean

Returns the pressed state of the META meta key.

open static Boolean
isModifierKey(keyCode: Int)

Returns true if this key code is a modifier key.

Boolean

Returns the locked state of the NUM LOCK meta key.

open Boolean

Returns true if this key produces a glyph.

Boolean

Returns the locked state of the SCROLL LOCK meta key.

Boolean

Returns the pressed state of the SHIFT meta key.

Boolean

Returns the pressed state of the SYM meta key.

Boolean

Is this a system key? System keys can not be used for menu shortcuts.

Boolean

For ACTION_UP events, indicates that the event is still being tracked from its initial down event as per FLAG_TRACKING.

open static Int
keyCodeFromString(symbolicName: String)

Gets a keycode by its symbolic name such as "KEYCODE_A" or an equivalent numeric constant such as "29".

open static String!
keyCodeToString(keyCode: Int)

Returns a string that represents the symbolic name of the specified keycode such as "KEYCODE_A", "KEYCODE_DPAD_UP", or an equivalent numeric constant such as "1001" if unknown.

open static Boolean
metaStateHasModifiers(metaState: Int, modifiers: Int)

Returns true if only the specified modifier keys are pressed according to the specified meta state.

open static Boolean

Returns true if no modifiers keys are pressed according to the specified meta state.

open static Int
normalizeMetaState(metaState: Int)

Normalizes the specified meta state.

Unit
setSource(source: Int)

Unit

Call this during Callback.onKeyDown to have the system track the key through its final up (possibly including a long press).

open String

Returns a string representation of the object.

open Unit
writeToParcel(out: Parcel, flags: Int)

Flatten this object in to a Parcel.

Inherited functions
Properties
static Parcelable.Creator<KeyEvent!>

Constants

ACTION_DOWN

Added in API level 1
static val ACTION_DOWN: Int

getAction value: the key has been pressed down.

Value: 0

ACTION_MULTIPLE

Added in API level 1
Deprecated in API level 29
static val ACTION_MULTIPLE: Int

Deprecated: No longer used by the input system. getAction value: multiple duplicate key events have occurred in a row, or a complex string is being delivered. If the key code is not KEYCODE_UNKNOWN then the getRepeatCount() method returns the number of times the given key code should be executed. Otherwise, if the key code is KEYCODE_UNKNOWN, then this is a sequence of characters as returned by getCharacters.

Value: 2

ACTION_UP

Added in API level 1
static val ACTION_UP: Int

getAction value: the key has been released.

Value: 1

FLAG_CANCELED

Added in API level 5
static val FLAG_CANCELED: Int

When associated with up key events, this indicates that the key press has been canceled. Typically this is used with virtual touch screen keys, where the user can slide from the virtual key area on to the display: in that case, the application will receive a canceled up event and should not perform the action normally associated with the key. Note that for this to work, the application can not perform an action for a key until it receives an up or the long press timeout has expired.

Value: 32

FLAG_CANCELED_LONG_PRESS

Added in API level 5
static val FLAG_CANCELED_LONG_PRESS: Int

Set when a key event has FLAG_CANCELED set because a long press action was executed while it was down.

Value: 256

FLAG_EDITOR_ACTION

Added in API level 3
static val FLAG_EDITOR_ACTION: Int

This mask is used for compatibility, to identify enter keys that are coming from an IME whose enter key has been auto-labelled "next" or "done". This allows TextView to dispatch these as normal enter keys for old applications, but still do the appropriate action when receiving them.

Value: 16

FLAG_FALLBACK

Added in API level 11
static val FLAG_FALLBACK: Int

Set when a key event has been synthesized to implement default behavior for an event that the application did not handle. Fallback key events are generated by unhandled trackball motions (to emulate a directional keypad) and by certain unhandled key presses that are declared in the key map (such as special function numeric keypad keys when numlock is off).

Value: 1024

FLAG_FROM_SYSTEM

Added in API level 3
static val FLAG_FROM_SYSTEM: Int

This mask is set if an event was known to come from a trusted part of the system. That is, the event is known to come from the user, and could not have been spoofed by a third party component.

Value: 8

FLAG_KEEP_TOUCH_MODE

Added in API level 3
static val FLAG_KEEP_TOUCH_MODE: Int

This mask is set if we don't want the key event to cause us to leave touch mode.

Value: 4

FLAG_LONG_PRESS

Added in API level 5
static val FLAG_LONG_PRESS: Int

This flag is set for the first key repeat that occurs after the long press timeout.

Value: 128

FLAG_SOFT_KEYBOARD

Added in API level 3
static val FLAG_SOFT_KEYBOARD: Int

This mask is set if the key event was generated by a software keyboard.

Value: 2

FLAG_TRACKING

Added in API level 5
static val FLAG_TRACKING: Int

Set for ACTION_UP when this event's key code is still being tracked from its initial down. That is, somebody requested that tracking started on the key down and a long press has not caused the tracking to be canceled.

Value: 512

FLAG_VIRTUAL_HARD_KEY

Added in API level 5
static val FLAG_VIRTUAL_HARD_KEY: Int

This key event was generated by a virtual (on-screen) hard key area. Typically this is an area of the touchscreen, outside of the regular display, dedicated to "hardware" buttons.

Value: 64

FLAG_WOKE_HERE

Added in API level 1
Deprecated in API level 20
static val FLAG_WOKE_HERE: Int

Deprecated: This flag will never be set by the system since the system consumes all wake keys itself.

This mask is set if the device woke because of this key event.

Value: 1

KEYCODE_0

Added in API level 1
static val KEYCODE_0: Int

Key code constant: '0' key.

Value: 7

KEYCODE_1

Added in API level 1
static val KEYCODE_1: Int

Key code constant: '1' key.

Value: 8

KEYCODE_11

Added in API level 21
static val KEYCODE_11: Int

Key code constant: '11' key.

Value: 227

KEYCODE_12

Added in API level 21
static val KEYCODE_12: Int

Key code constant: '12' key.

Value: 228

KEYCODE_2

Added in API level 1
static val KEYCODE_2: Int

Key code constant: '2' key.

Value: 9

KEYCODE_3

Added in API level 1
static val KEYCODE_3: Int

Key code constant: '3' key.

Value: 10

KEYCODE_3D_MODE

Added in API level 14
static val KEYCODE_3D_MODE: Int

Key code constant: 3D Mode key.

Toggles the display between 2D and 3D mode.

Value: 206

KEYCODE_4

Added in API level 1
static val KEYCODE_4: Int

Key code constant: '4' key.

Value: 11

KEYCODE_5

Added in API level 1
static val KEYCODE_5: Int

Key code constant: '5' key.

Value: 12

KEYCODE_6

Added in API level 1
static val KEYCODE_6: Int

Key code constant: '6' key.

Value: 13

KEYCODE_7

Added in API level 1
static val KEYCODE_7: Int

Key code constant: '7' key.

Value: 14

KEYCODE_8

Added in API level 1
static val KEYCODE_8: Int

Key code constant: '8' key.

Value: 15

KEYCODE_9

Added in API level 1
static val KEYCODE_9: Int

Key code constant: '9' key.

Value: 16

KEYCODE_A

Added in API level 1
static val KEYCODE_A: Int

Key code constant: 'A' key.

Value: 29

KEYCODE_ACCESSIBILITY

Added in API level 37
static val KEYCODE_ACCESSIBILITY: Int

Key code constant: System Accessibility key.

Introduced by HUTRR116, toggles the system bound accessibility UI/command (i.e. invoke system-specific accessibility UI or user-customized accessibility feature). Some example usages could be to toggle Talkback or toggle display color inversion. Applications will not receive this keycode.

Value: 338

KEYCODE_ALL_APPS

Added in API level 28
static val KEYCODE_ALL_APPS: Int

Key code constant: Show all apps.

Value: 284

KEYCODE_ALT_LEFT

Added in API level 1
static val KEYCODE_ALT_LEFT: Int

Key code constant: Left Alt modifier key.

Value: 57

KEYCODE_ALT_RIGHT

Added in API level 1
static val KEYCODE_ALT_RIGHT: Int

Key code constant: Right Alt modifier key.

Value: 58

KEYCODE_APOSTROPHE

Added in API level 1
static val KEYCODE_APOSTROPHE: Int

Key code constant: ''' (apostrophe) key.

Value: 75

KEYCODE_APP_SWITCH

Added in API level 11
static val KEYCODE_APP_SWITCH: Int

Key code constant: App switch key.

Should bring up the application switcher dialog.

Value: 187

KEYCODE_ASSIST

Added in API level 16
static val KEYCODE_ASSIST: Int

Key code constant: Assist key.

Launches the global assist activity. Not delivered to applications.

Value: 219

KEYCODE_AT

Added in API level 1
static val KEYCODE_AT: Int

Key code constant: '@' key.

Value: 77

KEYCODE_AVR_INPUT

Added in API level 11
static val KEYCODE_AVR_INPUT: Int

Key code constant: A/V Receiver input key.

On TV remotes, switches the input mode on an external A/V Receiver.

Value: 182

KEYCODE_AVR_POWER

Added in API level 11
static val KEYCODE_AVR_POWER: Int

Key code constant: A/V Receiver power key.

On TV remotes, toggles the power on an external A/V Receiver.

Value: 181

KEYCODE_B

Added in API level 1
static val KEYCODE_B: Int

Key code constant: 'B' key.

Value: 30

KEYCODE_BACK

Added in API level 1
static val KEYCODE_BACK: Int

Key code constant: Back key.

Value: 4

KEYCODE_BACKSLASH

Added in API level 1
static val KEYCODE_BACKSLASH: Int

Key code constant: '\' key.

Value: 73

KEYCODE_BOOKMARK

Added in API level 11
static val KEYCODE_BOOKMARK: Int

Key code constant: Bookmark key.

On some TV remotes, bookmarks content or web pages.

Value: 174

KEYCODE_BREAK

Added in API level 11
static val KEYCODE_BREAK: Int

Key code constant: Break / Pause key.

Value: 121

KEYCODE_BRIGHTNESS_DOWN

Added in API level 18
static val KEYCODE_BRIGHTNESS_DOWN: Int

Key code constant: Brightness Down key.

Adjusts the screen brightness down.

Value: 220

KEYCODE_BRIGHTNESS_UP

Added in API level 18
static val KEYCODE_BRIGHTNESS_UP: Int

Key code constant: Brightness Up key.

Adjusts the screen brightness up.

Value: 221

KEYCODE_BUTTON_1

Added in API level 12
static val KEYCODE_BUTTON_1: Int

Key code constant: Generic Game Pad Button #1.

Value: 188

KEYCODE_BUTTON_10

Added in API level 12
static val KEYCODE_BUTTON_10: Int

Key code constant: Generic Game Pad Button #10.

Value: 197

KEYCODE_BUTTON_11

Added in API level 12
static val KEYCODE_BUTTON_11: Int

Key code constant: Generic Game Pad Button #11.

Value: 198

KEYCODE_BUTTON_12

Added in API level 12
static val KEYCODE_BUTTON_12: Int

Key code constant: Generic Game Pad Button #12.

Value: 199

KEYCODE_BUTTON_13

Added in API level 12
static val KEYCODE_BUTTON_13: Int

Key code constant: Generic Game Pad Button #13.

Value: 200

KEYCODE_BUTTON_14

Added in API level 12
static val KEYCODE_BUTTON_14: Int

Key code constant: Generic Game Pad Button #14.

Value: 201

KEYCODE_BUTTON_15

Added in API level 12
static val KEYCODE_BUTTON_15: Int

Key code constant: Generic Game Pad Button #15.

Value: 202

KEYCODE_BUTTON_16

Added in API level 12
static val KEYCODE_BUTTON_16: Int

Key code constant: Generic Game Pad Button #16.

Value: 203

KEYCODE_BUTTON_2

Added in API level 12
static val KEYCODE_BUTTON_2: Int

Key code constant: Generic Game Pad Button #2.

Value: 189

KEYCODE_BUTTON_3

Added in API level 12
static val KEYCODE_BUTTON_3: Int

Key code constant: Generic Game Pad Button #3.

Value: 190

KEYCODE_BUTTON_4

Added in API level 12
static val KEYCODE_BUTTON_4: Int

Key code constant: Generic Game Pad Button #4.

Value: 191

KEYCODE_BUTTON_5

Added in API level 12
static val KEYCODE_BUTTON_5: Int

Key code constant: Generic Game Pad Button #5.

Value: 192

KEYCODE_BUTTON_6

Added in API level 12
static val KEYCODE_BUTTON_6: Int

Key code constant: Generic Game Pad Button #6.

Value: 193

KEYCODE_BUTTON_7

Added in API level 12
static val KEYCODE_BUTTON_7: Int

Key code constant: Generic Game Pad Button #7.

Value: 194

KEYCODE_BUTTON_8

Added in API level 12
static val KEYCODE_BUTTON_8: Int

Key code constant: Generic Game Pad Button #8.

Value: 195

KEYCODE_BUTTON_9

Added in API level 12
static val KEYCODE_BUTTON_9: Int

Key code constant: Generic Game Pad Button #9.

Value: 196

KEYCODE_BUTTON_A

Added in API level 9
static val KEYCODE_BUTTON_A: Int

Key code constant: A Button key.

On a game controller, the A button should be either the button labeled A or the first button on the bottom row of controller buttons.

Value: 96

KEYCODE_BUTTON_B

Added in API level 9
static val KEYCODE_BUTTON_B: Int

Key code constant: B Button key.

On a game controller, the B button should be either the button labeled B or the second button on the bottom row of controller buttons.

Value: 97

KEYCODE_BUTTON_C

Added in API level 9
static val KEYCODE_BUTTON_C: Int

Key code constant: C Button key.

On a game controller, the C button should be either the button labeled C or the third button on the bottom row of controller buttons.

Value: 98

KEYCODE_BUTTON_L1

Added in API level 9
static val KEYCODE_BUTTON_L1: Int

Key code constant: L1 Button key.

On a game controller, the L1 button should be either the button labeled L1 (or L) or the top left trigger button.

Value: 102

KEYCODE_BUTTON_L2

Added in API level 9
static val KEYCODE_BUTTON_L2: Int

Key code constant: L2 Button key.

On a game controller, the L2 button should be either the button labeled L2 or the bottom left trigger button.

Value: 104

KEYCODE_BUTTON_MODE

Added in API level 9
static val KEYCODE_BUTTON_MODE: Int

Key code constant: Mode Button key.

On a game controller, the button labeled Mode.

Value: 110

KEYCODE_BUTTON_R1

Added in API level 9
static val KEYCODE_BUTTON_R1: Int

Key code constant: R1 Button key.

On a game controller, the R1 button should be either the button labeled R1 (or R) or the top right trigger button.

Value: 103

KEYCODE_BUTTON_R2

Added in API level 9
static val KEYCODE_BUTTON_R2: Int

Key code constant: R2 Button key.

On a game controller, the R2 button should be either the button labeled R2 or the bottom right trigger button.

Value: 105

KEYCODE_BUTTON_SELECT

Added in API level 9
static val KEYCODE_BUTTON_SELECT: Int

Key code constant: Select Button key.

On a game controller, the button labeled Select.

Value: 109

KEYCODE_BUTTON_START

Added in API level 9
static val KEYCODE_BUTTON_START: Int

Key code constant: Start Button key.

On a game controller, the button labeled Start.

Value: 108

KEYCODE_BUTTON_THUMBL

Added in API level 9
static val KEYCODE_BUTTON_THUMBL: Int

Key code constant: Left Thumb Button key.

On a game controller, the left thumb button indicates that the left (or only) joystick is pressed.

Value: 106

KEYCODE_BUTTON_THUMBR

Added in API level 9
static val KEYCODE_BUTTON_THUMBR: Int

Key code constant: Right Thumb Button key.

On a game controller, the right thumb button indicates that the right joystick is pressed.

Value: 107

KEYCODE_BUTTON_X

Added in API level 9
static val KEYCODE_BUTTON_X: Int

Key code constant: X Button key.

On a game controller, the X button should be either the button labeled X or the first button on the upper row of controller buttons.

Value: 99

KEYCODE_BUTTON_Y

Added in API level 9
static val KEYCODE_BUTTON_Y: Int

Key code constant: Y Button key.

On a game controller, the Y button should be either the button labeled Y or the second button on the upper row of controller buttons.

Value: 100

KEYCODE_BUTTON_Z

Added in API level 9
static val KEYCODE_BUTTON_Z: Int

Key code constant: Z Button key.

On a game controller, the Z button should be either the button labeled Z or the third button on the upper row of controller buttons.

Value: 101

KEYCODE_C

Added in API level 1
static val KEYCODE_C: Int

Key code constant: 'C' key.

Value: 31

KEYCODE_CALCULATOR

Added in API level 15
static val KEYCODE_CALCULATOR: Int

Key code constant: Calculator special function key.

Used to launch a calculator application.

Value: 210

KEYCODE_CALENDAR

Added in API level 15
static val KEYCODE_CALENDAR: Int

Key code constant: Calendar special function key.

Used to launch a calendar application.

Value: 208

KEYCODE_CALL

Added in API level 1
static val KEYCODE_CALL: Int

Key code constant: Call key.

Value: 5

KEYCODE_CAMERA

Added in API level 1
static val KEYCODE_CAMERA: Int

Key code constant: Camera key.

Used to launch a camera application or take pictures.

Value: 27

KEYCODE_CAPS_LOCK

Added in API level 11
static val KEYCODE_CAPS_LOCK: Int

Key code constant: Caps Lock key.

Value: 115

KEYCODE_CAPTIONS

Added in API level 11
static val KEYCODE_CAPTIONS: Int

Key code constant: Toggle captions key.

Switches the mode for closed-captioning text, for example during television shows.

Value: 175

KEYCODE_CHANNEL_DOWN

Added in API level 11
static val KEYCODE_CHANNEL_DOWN: Int

Key code constant: Channel down key.

On TV remotes, decrements the television channel.

Value: 167

KEYCODE_CHANNEL_UP

Added in API level 11
static val KEYCODE_CHANNEL_UP: Int

Key code constant: Channel up key.

On TV remotes, increments the television channel.

Value: 166

KEYCODE_CLEAR

Added in API level 1
static val KEYCODE_CLEAR: Int

Key code constant: Clear key.

Value: 28

KEYCODE_CLOSE

Added in API level 36
static val KEYCODE_CLOSE: Int

Key code constant: AC Close.

e.g. To close current instance of the application window, close the current tab, etc.

Value: 321

KEYCODE_COMMA

Added in API level 1
static val KEYCODE_COMMA: Int

Key code constant: ',' key.

Value: 55

KEYCODE_CONTACTS

Added in API level 15
static val KEYCODE_CONTACTS: Int

Key code constant: Contacts special function key.

Used to launch an address book application.

Value: 207

KEYCODE_CONTEXTUAL_INSERT

Added in API level 37
static val KEYCODE_CONTEXTUAL_INSERT: Int

Key code constant: Contextual Insert key.

Introduced by HUTRR119, triggers a contextual overlay that enables the user to search, retrieve, and generate content for immediate insertion into the active focused element.

Value: 340

KEYCODE_CONTEXTUAL_QUERY

static val KEYCODE_CONTEXTUAL_QUERY: Int

Key code constant: Contextual Query key.

Introduced by HUTRR119, triggers contextual suggestions on active or hovered screen elements (e.g. an image or a paragraph) to discover available actions.

Value: 341
Added in API level 37
static val KEYCODE_CONTEXTUAL_SEARCH: Int

Key code constant: Contextual Search key.

Introduced by HUTRR119, invokes an AI agent to perform an action on the content currently selected by the user (e.g., highlighted text, active image, or selected file) or invoke a selection experience. Often referred to as "Select to Search" or "Summarize Selection." This key is fully handled by the framework and will not be sent to the foreground app.

Value: 339

KEYCODE_COPY

Added in API level 24
static val KEYCODE_COPY: Int

Key code constant: Copy key.

Value: 278

KEYCODE_CTRL_LEFT

Added in API level 11
static val KEYCODE_CTRL_LEFT: Int

Key code constant: Left Control modifier key.

Value: 113

KEYCODE_CTRL_RIGHT

Added in API level 11
static val KEYCODE_CTRL_RIGHT: Int

Key code constant: Right Control modifier key.

Value: 114

KEYCODE_CUT

Added in API level 24
static val KEYCODE_CUT: Int

Key code constant: Cut key.

Value: 277

KEYCODE_D

Added in API level 1
static val KEYCODE_D: Int

Key code constant: 'D' key.

Value: 32

KEYCODE_DEL

Added in API level 1
static val KEYCODE_DEL: Int

Key code constant: Backspace key.

Deletes characters before the insertion point, unlike KEYCODE_FORWARD_DEL.

Value: 67

KEYCODE_DEMO_APP_1

Added in API level 33
static val KEYCODE_DEMO_APP_1: Int

Key code constant: Demo Application key #1.

Value: 301

KEYCODE_DEMO_APP_2

Added in API level 33
static val KEYCODE_DEMO_APP_2: Int

Key code constant: Demo Application key #2.

Value: 302

KEYCODE_DEMO_APP_3

Added in API level 33
static val KEYCODE_DEMO_APP_3: Int

Key code constant: Demo Application key #3.

Value: 303

KEYCODE_DEMO_APP_4

Added in API level 33
static val KEYCODE_DEMO_APP_4: Int

Key code constant: Demo Application key #4.

Value: 304

KEYCODE_DICTATE

Added in API level 36
static val KEYCODE_DICTATE: Int

Key code constant: To start dictate to an input field

Value: 319

KEYCODE_DO_NOT_DISTURB

Added in API level 36
static val KEYCODE_DO_NOT_DISTURB: Int

Key code constant: To toggle 'Do Not Disturb' mode.

Value: 322

KEYCODE_DPAD_CENTER

Added in API level 1
static val KEYCODE_DPAD_CENTER: Int

Key code constant: Directional Pad Center key.

May also be synthesized from trackball motions.

Value: 23

KEYCODE_DPAD_DOWN

Added in API level 1
static val KEYCODE_DPAD_DOWN: Int

Key code constant: Directional Pad Down key.

May also be synthesized from trackball motions.

Value: 20

KEYCODE_DPAD_DOWN_LEFT

Added in API level 24
static val KEYCODE_DPAD_DOWN_LEFT: Int

Key code constant: Directional Pad Down-Left.

Value: 269

KEYCODE_DPAD_DOWN_RIGHT

Added in API level 24
static val KEYCODE_DPAD_DOWN_RIGHT: Int

Key code constant: Directional Pad Down-Right.

Value: 271

KEYCODE_DPAD_LEFT

Added in API level 1
static val KEYCODE_DPAD_LEFT: Int

Key code constant: Directional Pad Left key.

May also be synthesized from trackball motions.

Value: 21

KEYCODE_DPAD_RIGHT

Added in API level 1
static val KEYCODE_DPAD_RIGHT: Int

Key code constant: Directional Pad Right key.

May also be synthesized from trackball motions.

Value: 22

KEYCODE_DPAD_UP

Added in API level 1
static val KEYCODE_DPAD_UP: Int

Key code constant: Directional Pad Up key.

May also be synthesized from trackball motions.

Value: 19

KEYCODE_DPAD_UP_LEFT

Added in API level 24
static val KEYCODE_DPAD_UP_LEFT: Int

Key code constant: Directional Pad Up-Left.

Value: 268

KEYCODE_DPAD_UP_RIGHT

Added in API level 24
static val KEYCODE_DPAD_UP_RIGHT: Int

Key code constant: Directional Pad Up-Right.

Value: 270

KEYCODE_DVR

Added in API level 11
static val KEYCODE_DVR: Int

Key code constant: DVR key.

On some TV remotes, switches to a DVR mode for recorded shows.

Value: 173

KEYCODE_E

Added in API level 1
static val KEYCODE_E: Int

Key code constant: 'E' key.

Value: 33

KEYCODE_EISU

Added in API level 16
static val KEYCODE_EISU: Int

Key code constant: Japanese alphanumeric key.

Value: 212

KEYCODE_EMOJI_PICKER

Added in API level 35
static val KEYCODE_EMOJI_PICKER: Int

Key code constant: To open emoji picker.

Value: 317

KEYCODE_ENDCALL

Added in API level 1
static val KEYCODE_ENDCALL: Int

Key code constant: End Call key.

Value: 6

KEYCODE_ENTER

Added in API level 1
static val KEYCODE_ENTER: Int

Key code constant: Enter key.

Value: 66

KEYCODE_ENVELOPE

Added in API level 1
static val KEYCODE_ENVELOPE: Int

Key code constant: Envelope special function key.

Used to launch a mail application.

Value: 65

KEYCODE_EQUALS

Added in API level 1
static val KEYCODE_EQUALS: Int

Key code constant: '=' key.

Value: 70

KEYCODE_ESCAPE

Added in API level 11
static val KEYCODE_ESCAPE: Int

Key code constant: Escape key.

Value: 111

KEYCODE_EXPLORER

Added in API level 1
static val KEYCODE_EXPLORER: Int

Key code constant: Explorer special function key.

Used to launch a browser application.

Value: 64

KEYCODE_F

Added in API level 1
static val KEYCODE_F: Int

Key code constant: 'F' key.

Value: 34

KEYCODE_F1

Added in API level 11
static val KEYCODE_F1: Int

Key code constant: F1 key.

Value: 131

KEYCODE_F10

Added in API level 11
static val KEYCODE_F10: Int

Key code constant: F10 key.

Value: 140

KEYCODE_F11

Added in API level 11
static val KEYCODE_F11: Int

Key code constant: F11 key.

Value: 141

KEYCODE_F12

Added in API level 11
static val KEYCODE_F12: Int

Key code constant: F12 key.

Value: 142

KEYCODE_F13

Added in API level 36
static val KEYCODE_F13: Int

Key code constant: F13 key.

Value: 326

KEYCODE_F14

Added in API level 36
static val KEYCODE_F14: Int

Key code constant: F14 key.

Value: 327

KEYCODE_F15

Added in API level 36
static val KEYCODE_F15: Int

Key code constant: F15 key.

Value: 328

KEYCODE_F16

Added in API level 36
static val KEYCODE_F16: Int

Key code constant: F16 key.

Value: 329

KEYCODE_F17

Added in API level 36
static val KEYCODE_F17: Int

Key code constant: F17 key.

Value: 330

KEYCODE_F18

Added in API level 36
static val KEYCODE_F18: Int

Key code constant: F18 key.

Value: 331

KEYCODE_F19

Added in API level 36
static val KEYCODE_F19: Int

Key code constant: F19 key.

Value: 332

KEYCODE_F2

Added in API level 11
static val KEYCODE_F2: Int

Key code constant: F2 key.

Value: 132

KEYCODE_F20

Added in API level 36
static val KEYCODE_F20: Int

Key code constant: F20 key.

Value: 333

KEYCODE_F21

Added in API level 36
static val KEYCODE_F21: Int

Key code constant: F21 key.

Value: 334

KEYCODE_F22

Added in API level 36
static val KEYCODE_F22: Int

Key code constant: F22 key.

Value: 335

KEYCODE_F23

Added in API level 36
static val KEYCODE_F23: Int

Key code constant: F23 key.

Value: 336

KEYCODE_F24

Added in API level 36
static val KEYCODE_F24: Int

Key code constant: F24 key.

Value: 337

KEYCODE_F3

Added in API level 11
static val KEYCODE_F3: Int

Key code constant: F3 key.

Value: 133

KEYCODE_F4

Added in API level 11
static val KEYCODE_F4: Int

Key code constant: F4 key.

Value: 134

KEYCODE_F5

Added in API level 11
static val KEYCODE_F5: Int

Key code constant: F5 key.

Value: 135

KEYCODE_F6

Added in API level 11
static val KEYCODE_F6: Int

Key code constant: F6 key.

Value: 136

KEYCODE_F7

Added in API level 11
static val KEYCODE_F7: Int

Key code constant: F7 key.

Value: 137

KEYCODE_F8

Added in API level 11
static val KEYCODE_F8: Int

Key code constant: F8 key.

Value: 138

KEYCODE_F9

Added in API level 11
static val KEYCODE_F9: Int

Key code constant: F9 key.

Value: 139
Added in API level 33
static val KEYCODE_FEATURED_APP_1: Int

Key code constant: Featured Application key #1.

Value: 297
Added in API level 33
static val KEYCODE_FEATURED_APP_2: Int

Key code constant: Featured Application key #2.

Value: 298
Added in API level 33
static val KEYCODE_FEATURED_APP_3: Int

Key code constant: Featured Application key #3.

Value: 299
Added in API level 33
static val KEYCODE_FEATURED_APP_4: Int

Key code constant: Featured Application key #4.

Value: 300

KEYCODE_FOCUS

Added in API level 1
static val KEYCODE_FOCUS: Int

Key code constant: Camera Focus key.

Used to focus the camera.

Value: 80

KEYCODE_FORWARD

Added in API level 11
static val KEYCODE_FORWARD: Int

Key code constant: Forward key.

Navigates forward in the history stack. Complement of KEYCODE_BACK.

Value: 125

KEYCODE_FORWARD_DEL

Added in API level 11
static val KEYCODE_FORWARD_DEL: Int

Key code constant: Forward Delete key.

Deletes characters ahead of the insertion point, unlike KEYCODE_DEL.

Value: 112

KEYCODE_FULLSCREEN

Added in API level 36
static val KEYCODE_FULLSCREEN: Int

Key code constant: To toggle fullscreen mode (on the current application).

Value: 325

KEYCODE_FUNCTION

Added in API level 11
static val KEYCODE_FUNCTION: Int

Key code constant: Function modifier key.

Value: 119

KEYCODE_G

Added in API level 1
static val KEYCODE_G: Int

Key code constant: 'G' key.

Value: 35

KEYCODE_GRAVE

Added in API level 1
static val KEYCODE_GRAVE: Int

Key code constant: '`' (backtick) key.

Value: 68

KEYCODE_GUIDE

Added in API level 11
static val KEYCODE_GUIDE: Int

Key code constant: Guide key.

On TV remotes, shows a programming guide.

Value: 172

KEYCODE_H

Added in API level 1
static val KEYCODE_H: Int

Key code constant: 'H' key.

Value: 36

KEYCODE_HEADSETHOOK

Added in API level 1
static val KEYCODE_HEADSETHOOK: Int

Key code constant: Headset Hook key.

Used to hang up calls and stop media.

Value: 79

KEYCODE_HELP

Added in API level 21
static val KEYCODE_HELP: Int

Key code constant: Help key.

Value: 259

KEYCODE_HENKAN

Added in API level 16
static val KEYCODE_HENKAN: Int

Key code constant: Japanese conversion key.

Value: 214

KEYCODE_HOME

Added in API level 1
static val KEYCODE_HOME: Int

Key code constant: Home key.

This key is handled by the framework and is never delivered to applications.

Value: 3

KEYCODE_I

Added in API level 1
static val KEYCODE_I: Int

Key code constant: 'I' key.

Value: 37

KEYCODE_INFO

Added in API level 11
static val KEYCODE_INFO: Int

Key code constant: Info key.

Common on TV remotes to show additional information related to what is currently being viewed.

Value: 165

KEYCODE_INSERT

Added in API level 11
static val KEYCODE_INSERT: Int

Key code constant: Insert key.

Toggles insert / overwrite edit mode.

Value: 124

KEYCODE_J

Added in API level 1
static val KEYCODE_J: Int

Key code constant: 'J' key.

Value: 38

KEYCODE_K

Added in API level 1
static val KEYCODE_K: Int

Key code constant: 'K' key.

Value: 39

KEYCODE_KANA

Added in API level 16
static val KEYCODE_KANA: Int

Key code constant: Japanese kana key.

Value: 218

KEYCODE_KATAKANA_HIRAGANA

Added in API level 16
static val KEYCODE_KATAKANA_HIRAGANA: Int

Key code constant: Japanese katakana / hiragana key.

Value: 215

KEYCODE_KEYBOARD_BACKLIGHT_DOWN

Added in API level 34
static val KEYCODE_KEYBOARD_BACKLIGHT_DOWN: Int

Key code constant: Keyboard backlight down.

Value: 305

KEYCODE_KEYBOARD_BACKLIGHT_TOGGLE

Added in API level 34
static val KEYCODE_KEYBOARD_BACKLIGHT_TOGGLE: Int

Key code constant: Keyboard backlight toggle.

Value: 307

KEYCODE_KEYBOARD_BACKLIGHT_UP

Added in API level 34
static val KEYCODE_KEYBOARD_BACKLIGHT_UP: Int

Key code constant: Keyboard backlight up.

Value: 306

KEYCODE_L

Added in API level 1
static val KEYCODE_L: Int

Key code constant: 'L' key.

Value: 40

KEYCODE_LANGUAGE_SWITCH

Added in API level 14
static val KEYCODE_LANGUAGE_SWITCH: Int

Key code constant: Language Switch key.

Toggles the current input language such as switching between English and Japanese on a QWERTY keyboard. On some devices, the same function may be performed by pressing Shift + Spacebar.

Value: 204

KEYCODE_LAST_CHANNEL

Added in API level 21
static val KEYCODE_LAST_CHANNEL: Int

Key code constant: Last Channel key.

Goes to the last viewed channel.

Value: 229

KEYCODE_LEFT_BRACKET

Added in API level 1
static val KEYCODE_LEFT_BRACKET: Int

Key code constant: '[' key.

Value: 71

KEYCODE_LOCK

Added in API level 36
static val KEYCODE_LOCK: Int

Key code constant: To lock the screen.

Value: 324

KEYCODE_M

Added in API level 1
static val KEYCODE_M: Int

Key code constant: 'M' key.

Value: 41

KEYCODE_MACRO_1

Added in API level 34
static val KEYCODE_MACRO_1: Int

Key code constant: A button whose usage can be customized by the user through the system.

User customizable key #1.

Value: 313

KEYCODE_MACRO_2

Added in API level 34
static val KEYCODE_MACRO_2: Int

Key code constant: A button whose usage can be customized by the user through the system.

User customizable key #2.

Value: 314

KEYCODE_MACRO_3

Added in API level 34
static val KEYCODE_MACRO_3: Int

Key code constant: A button whose usage can be customized by the user through the system.

User customizable key #3.

Value: 315

KEYCODE_MACRO_4

Added in API level 34
static val KEYCODE_MACRO_4: Int

Key code constant: A button whose usage can be customized by the user through the system.

User customizable key #4.

Value: 316

KEYCODE_MANNER_MODE

Added in API level 14
static val KEYCODE_MANNER_MODE: Int

Key code constant: Manner Mode key.

Toggles silent or vibrate mode on and off to make the device behave more politely in certain settings such as on a crowded train. On some devices, the key may only operate when long-pressed.

Value: 205

KEYCODE_MEDIA_AUDIO_TRACK

Added in API level 19
static val KEYCODE_MEDIA_AUDIO_TRACK: Int

Key code constant: Audio Track key.

Switches the audio tracks.

Value: 222

KEYCODE_MEDIA_CLOSE

Added in API level 11
static val KEYCODE_MEDIA_CLOSE: Int

Key code constant: Close media key.

May be used to close a CD tray, for example.

Value: 128

KEYCODE_MEDIA_EJECT

Added in API level 11
static val KEYCODE_MEDIA_EJECT: Int

Key code constant: Eject media key.

May be used to eject a CD tray, for example.

Value: 129

KEYCODE_MEDIA_FAST_FORWARD

Added in API level 3
static val KEYCODE_MEDIA_FAST_FORWARD: Int

Key code constant: Fast Forward media key.

Value: 90

KEYCODE_MEDIA_NEXT

Added in API level 3
static val KEYCODE_MEDIA_NEXT: Int

Key code constant: Play Next media key.

Value: 87

KEYCODE_MEDIA_PAUSE

Added in API level 11
static val KEYCODE_MEDIA_PAUSE: Int

Key code constant: Pause media key.

Value: 127

KEYCODE_MEDIA_PLAY

Added in API level 11
static val KEYCODE_MEDIA_PLAY: Int

Key code constant: Play media key.

Value: 126

KEYCODE_MEDIA_PLAY_PAUSE

Added in API level 3
static val KEYCODE_MEDIA_PLAY_PAUSE: Int

Key code constant: Play/Pause media key.

Value: 85

KEYCODE_MEDIA_PREVIOUS

Added in API level 3
static val KEYCODE_MEDIA_PREVIOUS: Int

Key code constant: Play Previous media key.

Value: 88

KEYCODE_MEDIA_RECORD

Added in API level 11
static val KEYCODE_MEDIA_RECORD: Int

Key code constant: Record media key.

Value: 130

KEYCODE_MEDIA_REWIND

Added in API level 3
static val KEYCODE_MEDIA_REWIND: Int

Key code constant: Rewind media key.

Value: 89

KEYCODE_MEDIA_SKIP_BACKWARD

Added in API level 23
static val KEYCODE_MEDIA_SKIP_BACKWARD: Int

Key code constant: Skip backward media key.

Value: 273

KEYCODE_MEDIA_SKIP_FORWARD

Added in API level 23
static val KEYCODE_MEDIA_SKIP_FORWARD: Int

Key code constant: Skip forward media key.

Value: 272

KEYCODE_MEDIA_STEP_BACKWARD

Added in API level 23
static val KEYCODE_MEDIA_STEP_BACKWARD: Int

Key code constant: Step backward media key.

Steps media backward, one frame at a time.

Value: 275

KEYCODE_MEDIA_STEP_FORWARD

Added in API level 23
static val KEYCODE_MEDIA_STEP_FORWARD: Int

Key code constant: Step forward media key.

Steps media forward, one frame at a time.

Value: 274

KEYCODE_MEDIA_STOP

Added in API level 3
static val KEYCODE_MEDIA_STOP: Int

Key code constant: Stop media key.

Value: 86

KEYCODE_MEDIA_TOP_MENU

Added in API level 21
static val KEYCODE_MEDIA_TOP_MENU: Int

Key code constant: Media Top Menu key.

Goes to the top of media menu.

Value: 226

KEYCODE_MENU

Added in API level 1
static val KEYCODE_MENU: Int

Key code constant: Menu key.

Value: 82

KEYCODE_META_LEFT

Added in API level 11
static val KEYCODE_META_LEFT: Int

Key code constant: Left Meta modifier key.

Value: 117

KEYCODE_META_RIGHT

Added in API level 11
static val KEYCODE_META_RIGHT: Int

Key code constant: Right Meta modifier key.

Value: 118

KEYCODE_MINUS

Added in API level 1
static val KEYCODE_MINUS: Int

Key code constant: '-'.

Value: 69

KEYCODE_MOVE_END

Added in API level 11
static val KEYCODE_MOVE_END: Int

Key code constant: End Movement key.

Used for scrolling or moving the cursor around to the end of a line or to the bottom of a list.

Value: 123

KEYCODE_MOVE_HOME

Added in API level 11
static val KEYCODE_MOVE_HOME: Int

Key code constant: Home Movement key.

Used for scrolling or moving the cursor around to the start of a line or to the top of a list.

Value: 122

KEYCODE_MUHENKAN

Added in API level 16
static val KEYCODE_MUHENKAN: Int

Key code constant: Japanese non-conversion key.

Value: 213

KEYCODE_MUSIC

Added in API level 15
static val KEYCODE_MUSIC: Int

Key code constant: Music special function key.

Used to launch a music player application.

Value: 209

KEYCODE_MUTE

Added in API level 3
static val KEYCODE_MUTE: Int

Key code constant: Mute key.

Mute key for the microphone (unlike KEYCODE_VOLUME_MUTE, which is the speaker mute key).

Value: 91

KEYCODE_N

Added in API level 1
static val KEYCODE_N: Int

Key code constant: 'N' key.

Value: 42

KEYCODE_NAVIGATE_IN

Added in API level 23
static val KEYCODE_NAVIGATE_IN: Int

Key code constant: Navigate in key.

Activates the item that currently has focus or expands to the next level of a navigation hierarchy.

Value: 262

KEYCODE_NAVIGATE_NEXT

Added in API level 23
static val KEYCODE_NAVIGATE_NEXT: Int

Key code constant: Navigate to next key.

Advances to the next item in an ordered collection of items.

Value: 261

KEYCODE_NAVIGATE_OUT

Added in API level 23
static val KEYCODE_NAVIGATE_OUT: Int

Key code constant: Navigate out key.

Backs out one level of a navigation hierarchy or collapses the item that currently has focus.

Value: 263

KEYCODE_NAVIGATE_PREVIOUS

Added in API level 23
static val KEYCODE_NAVIGATE_PREVIOUS: Int

Key code constant: Navigate to previous key.

Goes backward by one item in an ordered collection of items.

Value: 260

KEYCODE_NEW

Added in API level 36
static val KEYCODE_NEW: Int

Key code constant: AC New.

e.g. To create a new instance of a window, open a new tab, etc.

Value: 320

KEYCODE_NOTIFICATION

Added in API level 1
static val KEYCODE_NOTIFICATION: Int

Key code constant: Notification key.

Value: 83

KEYCODE_NUM

Added in API level 1
static val KEYCODE_NUM: Int

Key code constant: Number modifier key.

Used to enter numeric symbols. This key is not Num Lock; it is more like KEYCODE_ALT_LEFT and is interpreted as an ALT key by android.text.method.MetaKeyKeyListener.

Value: 78

KEYCODE_NUMPAD_0

Added in API level 11
static val KEYCODE_NUMPAD_0: Int

Key code constant: Numeric keypad '0' key.

Value: 144

KEYCODE_NUMPAD_1

Added in API level 11
static val KEYCODE_NUMPAD_1: Int

Key code constant: Numeric keypad '1' key.

Value: 145

KEYCODE_NUMPAD_2

Added in API level 11
static val KEYCODE_NUMPAD_2: Int

Key code constant: Numeric keypad '2' key.

Value: 146

KEYCODE_NUMPAD_3

Added in API level 11
static val KEYCODE_NUMPAD_3: Int

Key code constant: Numeric keypad '3' key.

Value: 147

KEYCODE_NUMPAD_4

Added in API level 11
static val KEYCODE_NUMPAD_4: Int

Key code constant: Numeric keypad '4' key.

Value: 148

KEYCODE_NUMPAD_5

Added in API level 11
static val KEYCODE_NUMPAD_5: Int

Key code constant: Numeric keypad '5' key.

Value: 149

KEYCODE_NUMPAD_6

Added in API level 11
static val KEYCODE_NUMPAD_6: Int

Key code constant: Numeric keypad '6' key.

Value: 150

KEYCODE_NUMPAD_7

Added in API level 11
static val KEYCODE_NUMPAD_7: Int

Key code constant: Numeric keypad '7' key.

Value: 151

KEYCODE_NUMPAD_8

Added in API level 11
static val KEYCODE_NUMPAD_8: Int

Key code constant: Numeric keypad '8' key.

Value: 152

KEYCODE_NUMPAD_9

Added in API level 11
static val KEYCODE_NUMPAD_9: Int

Key code constant: Numeric keypad '9' key.

Value: 153

KEYCODE_NUMPAD_ADD

Added in API level 11
static val KEYCODE_NUMPAD_ADD: Int

Key code constant: Numeric keypad '+' key (for addition).

Value: 157

KEYCODE_NUMPAD_COMMA

Added in API level 11
static val KEYCODE_NUMPAD_COMMA: Int

Key code constant: Numeric keypad ',' key (for decimals or digit grouping).

Value: 159

KEYCODE_NUMPAD_DIVIDE

Added in API level 11
static val KEYCODE_NUMPAD_DIVIDE: Int

Key code constant: Numeric keypad '/' key (for division).

Value: 154

KEYCODE_NUMPAD_DOT

Added in API level 11
static val KEYCODE_NUMPAD_DOT: Int

Key code constant: Numeric keypad '.' key (for decimals or digit grouping).

Value: 158

KEYCODE_NUMPAD_ENTER

Added in API level 11
static val KEYCODE_NUMPAD_ENTER: Int

Key code constant: Numeric keypad Enter key.

Value: 160

KEYCODE_NUMPAD_EQUALS

Added in API level 11
static val KEYCODE_NUMPAD_EQUALS: Int

Key code constant: Numeric keypad '=' key.

Value: 161

KEYCODE_NUMPAD_LEFT_PAREN

Added in API level 11
static val KEYCODE_NUMPAD_LEFT_PAREN: Int

Key code constant: Numeric keypad '(' key.

Value: 162

KEYCODE_NUMPAD_MULTIPLY

Added in API level 11
static val KEYCODE_NUMPAD_MULTIPLY: Int

Key code constant: Numeric keypad '*' key (for multiplication).

Value: 155

KEYCODE_NUMPAD_RIGHT_PAREN

Added in API level 11
static val KEYCODE_NUMPAD_RIGHT_PAREN: Int

Key code constant: Numeric keypad ')' key.

Value: 163

KEYCODE_NUMPAD_SUBTRACT

Added in API level 11
static val KEYCODE_NUMPAD_SUBTRACT: Int

Key code constant: Numeric keypad '-' key (for subtraction).

Value: 156

KEYCODE_NUM_LOCK

Added in API level 11
static val KEYCODE_NUM_LOCK: Int

Key code constant: Num Lock key.

This is the Num Lock key; it is different from KEYCODE_NUM. This key alters the behavior of other keys on the numeric keypad.

Value: 143

KEYCODE_O

Added in API level 1
static val KEYCODE_O: Int

Key code constant: 'O' key.

Value: 43

KEYCODE_P

Added in API level 1
static val KEYCODE_P: Int

Key code constant: 'P' key.

Value: 44

KEYCODE_PAGE_DOWN

Added in API level 9
static val KEYCODE_PAGE_DOWN: Int

Key code constant: Page Down key.

Value: 93

KEYCODE_PAGE_UP

Added in API level 9
static val KEYCODE_PAGE_UP: Int

Key code constant: Page Up key.

Value: 92

KEYCODE_PAIRING

Added in API level 21
static val KEYCODE_PAIRING: Int

Key code constant: Pairing key.

Initiates peripheral pairing mode. Useful for pairing remote control devices or game controllers, especially if no other input mode is available.

Value: 225

KEYCODE_PASTE

Added in API level 24
static val KEYCODE_PASTE: Int

Key code constant: Paste key.

Value: 279

KEYCODE_PERIOD

Added in API level 1
static val KEYCODE_PERIOD: Int

Key code constant: '.' key.

Value: 56

KEYCODE_PICTSYMBOLS

Added in API level 9
static val KEYCODE_PICTSYMBOLS: Int

Key code constant: Picture Symbols modifier key.

Used to switch symbol sets (Emoji, Kao-moji).

Value: 94

KEYCODE_PLUS

Added in API level 1
static val KEYCODE_PLUS: Int

Key code constant: '+' key.

Value: 81

KEYCODE_POUND

Added in API level 1
static val KEYCODE_POUND: Int

Key code constant: '#' key.

Value: 18

KEYCODE_POWER

Added in API level 1
static val KEYCODE_POWER: Int

Key code constant: Power key.

Value: 26

KEYCODE_PRINT

Added in API level 36
static val KEYCODE_PRINT: Int

Key code constant: To print.

Value: 323

KEYCODE_PROFILE_SWITCH

Added in API level 29
static val KEYCODE_PROFILE_SWITCH: Int

Key code constant: Used to switch current android.accounts.Account that is consuming content.

May be consumed by system to set account globally.

Value: 288

KEYCODE_PROG_BLUE

Added in API level 11
static val KEYCODE_PROG_BLUE: Int

Key code constant: Blue "programmable" key.

On TV remotes, acts as a contextual/programmable key.

Value: 186

KEYCODE_PROG_GREEN

Added in API level 11
static val KEYCODE_PROG_GREEN: Int

Key code constant: Green "programmable" key.

On TV remotes, acts as a contextual/programmable key.

Value: 184

KEYCODE_PROG_RED

Added in API level 11
static val KEYCODE_PROG_RED: Int

Key code constant: Red "programmable" key.

On TV remotes, acts as a contextual/programmable key.

Value: 183

KEYCODE_PROG_YELLOW

Added in API level 11
static val KEYCODE_PROG_YELLOW: Int

Key code constant: Yellow "programmable" key.

On TV remotes, acts as a contextual/programmable key.

Value: 185

KEYCODE_Q

Added in API level 1
static val KEYCODE_Q: Int

Key code constant: 'Q' key.

Value: 45

KEYCODE_R

Added in API level 1
static val KEYCODE_R: Int

Key code constant: 'R' key.

Value: 46

KEYCODE_RECENT_APPS

Added in API level 34
static val KEYCODE_RECENT_APPS: Int

Key code constant: To open recent apps view (a.k.a. Overview).

This key is handled by the framework and is never delivered to applications.

Value: 312

KEYCODE_REFRESH

Added in API level 28
static val KEYCODE_REFRESH: Int

Key code constant: Refresh key.

Value: 285

KEYCODE_RIGHT_BRACKET

Added in API level 1
static val KEYCODE_RIGHT_BRACKET: Int

Key code constant: ']' key.

Value: 72

KEYCODE_RO

Added in API level 16
static val KEYCODE_RO: Int

Key code constant: Japanese Ro key.

Value: 217

KEYCODE_S

Added in API level 1
static val KEYCODE_S: Int

Key code constant: 'S' key.

Value: 47

KEYCODE_SCREENSHOT

Added in API level 35
static val KEYCODE_SCREENSHOT: Int

Key code constant: To take a screenshot.

This key is fully handled by the framework and will not be sent to the foreground app, unlike KEYCODE_SYSRQ which is sent to the app first and only if the app doesn't handle it, the framework handles it (to take a screenshot).

Value: 318

KEYCODE_SCROLL_LOCK

Added in API level 11
static val KEYCODE_SCROLL_LOCK: Int

Key code constant: Scroll Lock key.

Value: 116
Added in API level 1
static val KEYCODE_SEARCH: Int

Key code constant: Search key.

Value: 84

KEYCODE_SEMICOLON

Added in API level 1
static val KEYCODE_SEMICOLON: Int

Key code constant: ';' key.

Value: 74

KEYCODE_SETTINGS

Added in API level 11
static val KEYCODE_SETTINGS: Int

Key code constant: Settings key.

Starts the system settings activity.

Value: 176

KEYCODE_SHIFT_LEFT

Added in API level 1
static val KEYCODE_SHIFT_LEFT: Int

Key code constant: Left Shift modifier key.

Value: 59

KEYCODE_SHIFT_RIGHT

Added in API level 1
static val KEYCODE_SHIFT_RIGHT: Int

Key code constant: Right Shift modifier key.

Value: 60

KEYCODE_SLASH

Added in API level 1
static val KEYCODE_SLASH: Int

Key code constant: '/' key.

Value: 76

KEYCODE_SLEEP

Added in API level 20
static val KEYCODE_SLEEP: Int

Key code constant: Sleep key.

Puts the device to sleep. Behaves somewhat like KEYCODE_POWER but it has no effect if the device is already asleep.

Value: 223

KEYCODE_SOFT_LEFT

Added in API level 1
static val KEYCODE_SOFT_LEFT: Int

Key code constant: Soft Left key.

Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display.

Value: 1

KEYCODE_SOFT_RIGHT

Added in API level 1
static val KEYCODE_SOFT_RIGHT: Int

Key code constant: Soft Right key.

Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display.

Value: 2

KEYCODE_SOFT_SLEEP

Added in API level 24
static val KEYCODE_SOFT_SLEEP: Int

Key code constant: Put device to sleep unless a wakelock is held.

Value: 276

KEYCODE_SPACE

Added in API level 1
static val KEYCODE_SPACE: Int

Key code constant: Space key.

Value: 62

KEYCODE_STAR

Added in API level 1
static val KEYCODE_STAR: Int

Key code constant: '*' key.

Value: 17

KEYCODE_STB_INPUT

Added in API level 11
static val KEYCODE_STB_INPUT: Int

Key code constant: Set-top-box input key.

On TV remotes, switches the input mode on an external Set-top-box.

Value: 180

KEYCODE_STB_POWER

Added in API level 11
static val KEYCODE_STB_POWER: Int

Key code constant: Set-top-box power key.

On TV remotes, toggles the power on an external Set-top-box.

Value: 179

KEYCODE_STEM_1

Added in API level 24
static val KEYCODE_STEM_1: Int

Key code constant: Generic stem key 1 for Wear.

Value: 265

KEYCODE_STEM_2

Added in API level 24
static val KEYCODE_STEM_2: Int

Key code constant: Generic stem key 2 for Wear.

Value: 266

KEYCODE_STEM_3

Added in API level 24
static val KEYCODE_STEM_3: Int

Key code constant: Generic stem key 3 for Wear.

Value: 267

KEYCODE_STEM_PRIMARY

Added in API level 24
static val KEYCODE_STEM_PRIMARY: Int

Key code constant: Primary stem key for Wear.

Main power/reset button on watch.

Value: 264

KEYCODE_STYLUS_BUTTON_PRIMARY

Added in API level 34
static val KEYCODE_STYLUS_BUTTON_PRIMARY: Int

Key code constant: The primary button on the barrel of a stylus.

This is usually the button closest to the tip of the stylus.

Value: 308

KEYCODE_STYLUS_BUTTON_SECONDARY

Added in API level 34
static val KEYCODE_STYLUS_BUTTON_SECONDARY: Int

Key code constant: The secondary button on the barrel of a stylus.

This is usually the second button from the tip of the stylus.

Value: 309

KEYCODE_STYLUS_BUTTON_TAIL

Added in API level 34
static val KEYCODE_STYLUS_BUTTON_TAIL: Int

Key code constant: A button on the tail end of a stylus.

The use of this button does not usually correspond to the function of an eraser.

Value: 311

KEYCODE_STYLUS_BUTTON_TERTIARY

Added in API level 34
static val KEYCODE_STYLUS_BUTTON_TERTIARY: Int

Key code constant: The tertiary button on the barrel of a stylus.

This is usually the third button from the tip of the stylus.

Value: 310

KEYCODE_SWITCH_CHARSET

Added in API level 9
static val KEYCODE_SWITCH_CHARSET: Int

Key code constant: Switch Charset modifier key.

Used to switch character sets (Kanji, Katakana).

Value: 95

KEYCODE_SYM

Added in API level 1
static val KEYCODE_SYM: Int

Key code constant: Symbol modifier key.

Used to enter alternate symbols.

Value: 63

KEYCODE_SYSRQ

Added in API level 11
static val KEYCODE_SYSRQ: Int

Key code constant: System Request / Print Screen key.

This key is sent to the app first and only if the app doesn't handle it, the framework handles it (to take a screenshot), unlike KEYCODE_SCREENSHOT which is fully handled by the framework.

Value: 120

KEYCODE_SYSTEM_NAVIGATION_DOWN

Added in API level 25
static val KEYCODE_SYSTEM_NAVIGATION_DOWN: Int

Key code constant: Consumed by the system for navigation down.

Value: 281

KEYCODE_SYSTEM_NAVIGATION_LEFT

Added in API level 25
static val KEYCODE_SYSTEM_NAVIGATION_LEFT: Int

Key code constant: Consumed by the system for navigation left.

Value: 282

KEYCODE_SYSTEM_NAVIGATION_RIGHT

Added in API level 25
static val KEYCODE_SYSTEM_NAVIGATION_RIGHT: Int

Key code constant: Consumed by the system for navigation right.

Value: 283

KEYCODE_SYSTEM_NAVIGATION_UP

Added in API level 25
static val KEYCODE_SYSTEM_NAVIGATION_UP: Int

Key code constant: Consumed by the system for navigation up.

Value: 280

KEYCODE_T

Added in API level 1
static val KEYCODE_T: Int

Key code constant: 'T' key.

Value: 48

KEYCODE_TAB

Added in API level 1
static val KEYCODE_TAB: Int

Key code constant: T