Key

  • Cmn
    value class Key

Represents keys on a keyboard.

import androidx.compose.foundation.focusable
import androidx.compose.foundation.layout.Box
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.key.Key
import androidx.compose.ui.input.key.isAltPressed
import androidx.compose.ui.input.key.key
import androidx.compose.ui.input.key.onKeyEvent

Box(
    Modifier.onKeyEvent {
            if (it.isAltPressed && it.key == Key.A) {
                println("Alt + A is pressed")
                true
            } else {
                false
            }
        }
        .focusable()
)

Summary

Public companion properties

Key

'A' key.

Cmn
android
Key

Show all apps.

Cmn
android
Key

Left Alt modifier key.

Cmn
android
Key

Right Alt modifier key.

Cmn
android
Key

''' (apostrophe) key.

Cmn
android
Key

App switch key.

Cmn
android
Key

Assist key.

Cmn
android
Key

'@' key.

Cmn
android
Key

A/V Receiver input key.

Cmn
android
Key

A/V Receiver power key.

Cmn
android
Key

'B' key.

Cmn
android
Key

Back key.

Cmn
android
Key

'\' key.

Cmn
android
Key

Backspace key.

Cmn
android
Key

Bookmark key.

Cmn
android
Key

Break / Pause key.

Cmn
android
Key

Brightness Down key.

Cmn
android
Key

Brightness Up key.

Cmn
android
Key

Browser special function key.

Cmn
android
Key

Generic Game Pad Button #1.

Cmn
android
Key

Generic Game Pad Button #10.

Cmn
android
Key

Generic Game Pad Button #11.

Cmn
android
Key

Generic Game Pad Button #12.

Cmn
android
Key

Generic Game Pad Button #13.

Cmn
android
Key

Generic Game Pad Button #14.

Cmn
android
Key

Generic Game Pad Button #15.

Cmn
android
Key

Generic Game Pad Button #16.

Cmn
android
Key

Generic Game Pad Button #2.

Cmn
android
Key

Generic Game Pad Button #3.

Cmn
android
Key

Generic Game Pad Button #4.

Cmn
android
Key

Generic Game Pad Button #5.

Cmn
android
Key

Generic Game Pad Button #6.

Cmn
android
Key

Generic Game Pad Button #7.

Cmn
android
Key

Generic Game Pad Button #8.

Cmn
android
Key

Generic Game Pad Button #9.

Cmn
android
Key

A Button key.

Cmn
android
Key

B Button key.

Cmn
android
Key

C Button key.

Cmn
android
Key

L1 Button key.

Cmn
android
Key

L2 Button key.

Cmn
android
Key

Mode Button key.

Cmn
android
Key

R1 Button key.

Cmn
android
Key

R2 Button key.

Cmn
android
Key

Select Button key.

Cmn
android
Key

Start Button key.

Cmn
android
Key

Left Thumb Button key.

Cmn
android
Key

Right Thumb Button key.

Cmn
android
Key

X Button key.

Cmn
android
Key

Y Button key.

Cmn
android
Key

Z Button key.

Cmn
android
Key

'C' key.

Cmn
android
Key

Calculator special function key.

Cmn
android
Key

Calendar special function key.

Cmn
android
Key

Call key.

Cmn
android
Key

Camera key.

Cmn
android
Key

Caps Lock key.

Cmn
android
Key

Toggle captions key.

Cmn
android
Key

Channel down key.

Cmn
android
Key

Channel up key.

Cmn
android
Key

Clear key.

Cmn
android
Key

',' key.

Cmn
android
Key

Contacts special function key.

Cmn
android
Key

Copy key.

Cmn
android
Key

Left Control modifier key.

Cmn
android
Key

Right Control modifier key.

Cmn
android
Key

Cut key.

Cmn
android
Key

'D' key.

Cmn
android
Key

Delete key.

Cmn
android
Key

Center Arrow Key / Directional Pad Center key.

Cmn
android
Key

Down Arrow Key / Directional Pad Down key.

Cmn
android
Key

Directional Pad Down-Left.

Cmn
android
Key

Directional Pad Down-Right.

Cmn
android
Key

Left Arrow Key / Directional Pad Left key.

Cmn
android
Key

Right Arrow Key / Directional Pad Right key.

Cmn
android
Key

Up Arrow Key / Directional Pad Up key.

Cmn
android
Key

Directional Pad Up-Left.

Cmn
android
Key

Directional Pad Up-Right.

Cmn
android
Key

DVR key.

Cmn
android
Key

'E' key.

Cmn
android
Key

'8' key.

Cmn
android
Key

Japanese alphanumeric key.

Cmn
android
Key

End Call key.

Cmn
android
Key

Enter key.

Cmn
android
Key

Envelope special function key.

Cmn
android
Key

'=' key.

Cmn
android
Key

Escape key.

Cmn
android
Key

'F' key.

Cmn
android
Key

F1 key.

Cmn
android
Key

F10 key.

Cmn
android
Key

F11 key.

Cmn
android
Key

F12 key.

Cmn
android
Key

F2 key.

Cmn
android
Key

F3 key.

Cmn
android
Key

F4 key.

Cmn
android
Key

F5 key.

Cmn
android
Key

F6 key.

Cmn
android
Key

F7 key.

Cmn
android
Key

F8 key.

Cmn
android
Key

F9 key.

Cmn
android
Key

'5' key.

Cmn
android
Key

Camera Focus key.

Cmn
android
Key

Forward key.

Cmn
android
Key

'4' key.

Cmn
android
Key

Function modifier key.

Cmn
android
Key

'G' key.

Cmn
android
Key

'`' (backtick) key.

Cmn
android
Key

Guide key.

Cmn
android
Key

'H' key.

Cmn
android
Key

Headset Hook key.

Cmn
android
Key

Help key.

Cmn
android
Key

Japanese conversion key.

Cmn
android
Key

Home key.

Cmn
android
Key

'I' key.

Cmn
android
Key

Info key.

Cmn
android
Key

Insert key.

Cmn
android
Key

'J' key.

Cmn
android
Key

'K' key.

Cmn
android
Key

Japanese kana key.

Cmn
android
Key

Japanese katakana / hiragana key.

Cmn
android
Key

'L' key.

Cmn
android
Key

Language Switch key.

Cmn
android
Key

Last Channel key.

Cmn
android
Key

'[' key.

Cmn
android
Key

'M' key.

Cmn
android
Key

Manner Mode key.

Cmn
android
Key

Audio Track key.

Cmn
android
Key

Close media key.

Cmn
android
Key

Eject media key.

Cmn
android
Key

Fast Forward media key.

Cmn
android
Key

Play Next media key.

Cmn
android
Key

Pause media key.

Cmn
android
Key

Play media key.

Cmn
android
Key

Play/Pause media key.

Cmn
android
Key

Play Previous media key.

Cmn
android
Key

Record media key.

Cmn
android
Key

Rewind media key.

Cmn
android
Key

Skip backward media key.

Cmn
android
Key

Skip forward media key.

Cmn
android
Key

Step backward media key.

Cmn
android
Key

Step forward media key.

Cmn
android
Key

Stop media key.

Cmn
android
Key

Media Top Menu key.

Cmn
android
Key

Menu key.

Cmn
android
Key

Left Meta modifier key.

Cmn
android
Key

Right Meta modifier key.

Cmn
android
Key

Mute key.

Cmn
android
Key

'-' key.

Cmn
android
Key

End Movement key.

Cmn
android
Key

Home Movement key.

Cmn
android
Key

Japanese non-conversion key.

Cmn
android
Key

'*' key.

Cmn
android
Key

Music special function key.

Cmn
android
Key

'N' key.

Cmn
android
Key

Navigate in key.

Cmn
android
Key

Navigate to next key.

Cmn
android
Key

Navigate out key.

Cmn
android
Key

Navigate to previous key.

Cmn
android
Key

'9' key.

Cmn
android
Key

Notification key.

Cmn
android
Key

Num Lock key.

Cmn
android
Key

Numeric keypad '0' key.

Cmn
android
Key

Numeric keypad '1' key.

Cmn
android
Key

Numeric keypad '2' key.

Cmn
android
Key

Numeric keypad '3' key.

Cmn
android
Key

Numeric keypad '4' key.

Cmn
android
Key

Numeric keypad '5' key.

Cmn
android
Key

Numeric keypad '6' key.

Cmn
android
Key

Numeric keypad '7' key.

Cmn
android
Key

Numeric keypad '8' key.

Cmn
android
Key

Numeric keypad '9' key.

Cmn
android
Key

Numeric keypad '+' key (for addition).

Cmn
android
Key

Numeric keypad ',' key (for decimals or digit grouping).

Cmn
android
Key

Numeric keypad '/' key (for division).

Cmn
android
Key

Numeric keypad '.' key (for decimals or digit grouping).

Cmn
android
Key

Numeric keypad Enter key.

Cmn
android
Key

Numeric keypad '=' key.

Cmn
android
Key

Numeric keypad '(' key.

Cmn
android
Key

Numeric keypad '*' key (for multiplication).

Cmn
android
Key

Numeric keypad ')' key.

Cmn
android
Key

Numeric keypad '-' key (for subtraction).

Cmn
android
Key

Number modifier key.

Cmn
android
Key

'O' key.

Cmn
android
Key

'1' key.

Cmn
android
Key

'P' key.

Cmn
android
Key

Page Down key.

Cmn
android
Key

Page Up key.

Cmn
android
Key

Pairing key.

Cmn
android
Key

Paste key.

Cmn
android
Key

'.' key.

Cmn
android
Key

Picture Symbols modifier key.

Cmn
android
Key

'+' key.

Cmn
android
Key

'#' key.

Cmn
android
Key

Power key.

Cmn
android
Key

System Request / Print Screen key.

Cmn
android
Key

Used to switch current android.accounts.Account that is consuming content.

Cmn
android
Key

Blue "programmable" key.

Cmn
android
Key

Green "programmable" key.

Cmn
android
Key

Red "programmable" key.

Cmn
android
Key

Yellow "programmable" key.

Cmn
android
Key

'Q' key.

Cmn
android
Key

'R' key.

Cmn
android
Key

Refresh key.

Cmn
android
Key

']' key.

Cmn
android
Key

Japanese Ro key.

Cmn
android
Key

'S' key.

Cmn
android
Key

Scroll Lock key.

Cmn
android
Key

Search key.

Cmn
android
Key

';' key.

Cmn
android
Key

Set-top-box input key.

Cmn
android
Key

Set-top-box power key.

Cmn
android
Key

Settings key.

Cmn
android
Key

'7' key.

Cmn
android
Key

Left Shift modifier key.

Cmn
android
Key

Right Shift modifier key.

Cmn
android
Key

'6' key.

Cmn
android
Key

'/' key.

Cmn
android
Key

Sleep key.

Cmn
android
Key

Soft Left key.

Cmn
android
Key

Soft Right key.

Cmn
android
Key

Put device to sleep unless a wakelock is held.

Cmn
android
Key

Space key.

Cmn
android
Key

Generic stem key 1 for Wearables.

Cmn
android
Key

Generic stem key 2 for Wearables.

Cmn
android
Key

Generic stem key 3 for Wearables.

Cmn
android
Key

Primary stem key for Wearables.

Cmn
android
Key

Switch Charset modifier key.

Cmn
android
Key

Symbol modifier key.

Cmn
android
Key

Consumed by the system for navigation down.

Cmn
android
Key

Consumed by the system for navigation left.

Cmn
android
Key

Consumed by the system for navigation right.

Cmn
android
Key

Consumed by the system for navigation up.

Cmn
android
Key

'T' key.

Cmn
android
Key

Tab key.

Cmn
android
Key

'3' key.

Cmn
android
Key

Thumbs down key.

Cmn
android
Key

Thumbs up key.

Cmn
android
Key

3D Mode key.

Cmn
android
Key

TV key.

Cmn
android
Key

Antenna/Cable key.

Cmn
android
Key

Audio description key.

Cmn
android
Key

Audio description mixing volume down key.

Cmn
android
Key

Audio description mixing volume up key.

Cmn
android
Key

Contents menu key.

Cmn
android
Key

TV data service key.

Cmn
android
Key

TV input key.

Cmn
android
Key

Component #1 key.

Cmn
android
Key

Component #2 key.

Cmn
android
Key

Composite #1 key.

Cmn
android
Key

Composite #2 key.

Cmn
android
Key

HDMI #1 key.

Cmn
android
Key

HDMI #2 key.

Cmn
android
Key

HDMI #3 key.

Cmn
android
Key

HDMI #4 key.

Cmn
android
Key

VGA #1 key.

Cmn
android
Key

Media context menu key.

Cmn
android
Key

Toggle Network key.

Cmn
android
Key

Number entry key.

Cmn
android
Key

TV power key.

Cmn
android
Key

Radio key.

Cmn
android
Key

Satellite key.

Cmn
android
Key

BS key.

Cmn
android
Key

CS key.

Cmn
android
Key

BS/CS key.

Cmn
android
Key

Teletext key.

Cmn
android
Key

Analog Terrestrial key.

Cmn
android
Key

Digital Terrestrial key.

Cmn
android
Key

Timer programming key.

Cmn
android
Key

Zoom mode key.

Cmn
android
Key

'2' key.

Cmn
android
Key

'U' key.

Cmn
android
Key

Unknown key.

Cmn
android
Key

'V' key.

Cmn
android
Key

Voice Assist key.

Cmn
android
Key

Volume Down key.

Cmn
android
Key

Volume Mute key.

Cmn
android
Key

Volume Up key.

Cmn
android
Key

'W' key.

Cmn
android
Key

Wakeup key.

Cmn
android
Key

Window key.

Cmn
android
Key

'X' key.

Cmn
android
Key

'Y' key.

Cmn
android
Key

Japanese Yen key.

Cmn
android
Key

'Z' key.

Cmn
android
Key

Japanese full-width / half-width key.

Cmn
android
Key

'0' key.

Cmn
android
Key

Zoom in key.

Cmn
android
Key

Zoom out key.

Cmn
android

Public constructors

Key(keyCode: Long)
android
Key(keyCode: Long)
Cmn

Public functions

open String
Cmn
android

Public properties

Long

an integer code representing the key pressed.

android
Long

a Long value representing the key pressed.

Cmn

Extension properties

Int

The native keycode corresponding to this Key.

android

Public companion properties

A

val AKey

'A' key.

AllApps

val AllAppsKey

Show all apps.

AltLeft

val AltLeftKey

Left Alt modifier key.

AltRight

val AltRightKey

Right Alt modifier key.

Apostrophe

val ApostropheKey

''' (apostrophe) key.

AppSwitch

val AppSwitchKey

App switch key.

Should bring up the application switcher dialog.

Assist

val AssistKey

Assist key.

Launches the global assist activity. Not delivered to applications.

At

val AtKey

'@' key.

AvReceiverInput

val AvReceiverInputKey

A/V Receiver input key.

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

AvReceiverPower

val AvReceiverPowerKey

A/V Receiver power key.

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

B

val BKey

'B' key.

Back

val BackKey

Back key.

Backslash

val BackslashKey

'\' key.

Backspace

val BackspaceKey

Backspace key.

Deletes characters before the insertion point, unlike Delete.

Bookmark

val BookmarkKey

Bookmark key.

On some TV remotes, bookmarks content or web pages.

Break

val BreakKey

Break / Pause key.

BrightnessDown

val BrightnessDownKey

Brightness Down key.

Adjusts the screen brightness down.

BrightnessUp

val BrightnessUpKey

Brightness Up key.

Adjusts the screen brightness up.

Browser

val BrowserKey

Browser special function key.

Used to launch a browser application.

Button1

val Button1Key

Generic Game Pad Button #1.

Button10

val Button10Key

Generic Game Pad Button #10.

Button11

val Button11Key

Generic Game Pad Button #11.

Button12

val Button12Key

Generic Game Pad Button #12.

Button13

val Button13Key

Generic Game Pad Button #13.

Button14

val Button14Key

Generic Game Pad Button #14.

Button15

val Button15Key

Generic Game Pad Button #15.

Button16

val Button16Key

Generic Game Pad Button #16.

Button2

val Button2Key

Generic Game Pad Button #2.

Button3

val Button3Key

Generic Game Pad Button #3.

Button4

val Button4Key

Generic Game Pad Button #4.

Button5

val Button5Key

Generic Game Pad Button #5.

Button6

val Button6Key

Generic Game Pad Button #6.

Button7

val Button7Key

Generic Game Pad Button #7.

Button8

val Button8Key

Generic Game Pad Button #8.

Button9

val Button9Key

Generic Game Pad Button #9.

ButtonA

val ButtonAKey

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.

ButtonB

val ButtonBKey

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.

ButtonC

val ButtonCKey

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.

ButtonL1

val ButtonL1Key

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.

ButtonL2

val ButtonL2Key

L2 Button key.

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

ButtonMode

val ButtonModeKey

Mode Button key.

On a game controller, the button labeled Mode.

ButtonR1

val ButtonR1Key

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.

ButtonR2

val ButtonR2Key

R2 Button key.

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

ButtonSelect

val ButtonSelectKey

Select Button key.

On a game controller, the button labeled Select.

ButtonStart

val ButtonStartKey

Start Button key.

On a game controller, the button labeled Start.

ButtonThumbLeft

val ButtonThumbLeftKey

Left Thumb Button key.

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

ButtonThumbRight

val ButtonThumbRightKey

Right Thumb Button key.

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

ButtonX

val ButtonXKey

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.

ButtonY

val ButtonYKey

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.

ButtonZ

val ButtonZKey

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.

C

val CKey

'C' key.

Calculator

val CalculatorKey

Calculator special function key.

Used to launch a calculator application.

Calendar

val CalendarKey

Calendar special function key.

Used to launch a calendar application.

Call

val CallKey

Call key.

Camera

val CameraKey

Camera key.

Used to launch a camera application or take pictures.

CapsLock

val CapsLockKey

Caps Lock key.

Captions

val CaptionsKey

Toggle captions key.

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

ChannelDown

val ChannelDownKey

Channel down key.

On TV remotes, decrements the television channel.

ChannelUp

val ChannelUpKey

Channel up key.

On TV remotes, increments the television channel.

Clear

val ClearKey

Clear key.

Comma

val CommaKey

',' key.

Contacts

val ContactsKey

Contacts special function key.

Used to launch an address book application.

Copy

val CopyKey

Copy key.

CtrlLeft

val CtrlLeftKey

Left Control modifier key.

CtrlRight

val CtrlRightKey

Right Control modifier key.

Cut

val CutKey

Cut key.

D

val DKey

'D' key.

Delete

val DeleteKey

Delete key.

Deletes characters ahead of the insertion point, unlike Backspace.

DirectionCenter

val DirectionCenterKey

Center Arrow Key / Directional Pad Center key.

May also be synthesized from trackball motions.

DirectionDown

val DirectionDownKey

Down Arrow Key / Directional Pad Down key.

May also be synthesized from trackball motions.

DirectionDownLeft

val DirectionDownLeftKey

Directional Pad Down-Left.

DirectionDownRight

val DirectionDownRightKey

Directional Pad Down-Right.

DirectionLeft

val DirectionLeftKey

Left Arrow Key / Directional Pad Left key.

May also be synthesized from trackball motions.

DirectionRight

val DirectionRightKey

Right Arrow Key / Directional Pad Right key.

May also be synthesized from trackball motions.

DirectionUp

val DirectionUpKey

Up Arrow Key / Directional Pad Up key.

May also be synthesized from trackball motions.

DirectionUpLeft

val DirectionUpLeftKey

Directional Pad Up-Left.

DirectionUpRight

val DirectionUpRightKey

Directional Pad Up-Right.

Dvr

val DvrKey

DVR key.

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

E

val EKey

'E' key.

Eight

val EightKey

'8' key.

Eisu

val EisuKey

Japanese alphanumeric key.

EndCall

val EndCallKey

End Call key.

Enter

val EnterKey

Enter key.

Envelope

val EnvelopeKey

Envelope special function key.

Used to launch a mail application.

Equals

val EqualsKey

'=' key.

Escape

val EscapeKey

Escape key.

F

val FKey

'F' key.

F1

val F1Key

F1 key.

F10

val F10Key

F10 key.

F11

val F11Key

F11 key.

F12

val F12Key

F12 key.

F2

val F2Key

F2 key.

F3

val F3Key

F3 key.

F4

val F4Key

F4 key.

F5

val F5Key

F5 key.

F6

val F6Key

F6 key.

F7

val F7Key

F7 key.

F8

val F8Key

F8 key.

F9

val F9Key

F9 key.

Five

val FiveKey

'5' key.

Focus

val FocusKey

Camera Focus key.

Used to focus the camera.

Forward

val ForwardKey

Forward key.

Navigates forward in the history stack. Complement of Back.

Four

val FourKey

'4' key.

Function

val FunctionKey

Function modifier key.

G

val GKey

'G' key.

Grave

val GraveKey

'`' (backtick) key.

Guide

val GuideKey

Guide key.

On TV remotes, shows a programming guide.

H

val HKey

'H' key.

HeadsetHook

val HeadsetHookKey

Headset Hook key.

Used to hang up calls and stop media.

Help

val HelpKey

Help key.

Henkan

val HenkanKey

Japanese conversion key.

Home

val HomeKey

Home key.

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

I

val IKey

'I' key.

Info

val InfoKey

Info key.

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

Insert

val InsertKey

Insert key.

Toggles insert / overwrite edit mode.

J

val JKey

'J' key.

K

val KKey

'K' key.

Kana

val KanaKey

Japanese kana key.

KatakanaHiragana

val KatakanaHiraganaKey

Japanese katakana / hiragana key.

L

val LKey

'L' key.

LanguageSwitch

val LanguageSwitchKey

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+Space.

LastChannel

val LastChannelKey

Last Channel key.

Goes to the last viewed channel.

LeftBracket

val LeftBracketKey

'[' key.

M

val MKey

'M' key.

MannerMode

val MannerModeKey

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.

MediaAudioTrack

val MediaAudioTrackKey

Audio Track key.

Switches the audio tracks.

MediaClose

val MediaCloseKey

Close media key.

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

MediaEject

val MediaEjectKey

Eject media key.

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

MediaFastForward

val MediaFastForwardKey

Fast Forward media key.

MediaNext

val MediaNextKey

Play Next media key.

MediaPause

val MediaPauseKey

Pause media key.

MediaPlay

val MediaPlayKey

Play media key.

MediaPlayPause

val MediaPlayPauseKey

Play/Pause media key.

MediaPrevious

val MediaPreviousKey

Play Previous media key.

MediaRecord

val MediaRecordKey

Record media key.

MediaRewind

val MediaRewindKey

Rewind media key.

MediaSkipBackward

val MediaSkipBackwardKey

Skip backward media key.

MediaSkipForward

val MediaSkipForwardKey

Skip forward media key.

MediaStepBackward

val MediaStepBackwardKey

Step backward media key.

Steps media backward, one frame at a time.

MediaStepForward

val MediaStepForwardKey

Step forward media key.

Steps media forward, one frame at a time.

MediaStop

val MediaStopKey

Stop media key.

MediaTopMenu

val MediaTopMenuKey

Media Top Menu key.

Goes to the top of media menu.

val MenuKey

Menu key.

MetaLeft

val MetaLeftKey

Left Meta modifier key.

MetaRight

val MetaRightKey

Right Meta modifier key.

MicrophoneMute

val MicrophoneMuteKey

Mute key.

Mutes the microphone, unlike VolumeMute.

Minus

val MinusKey

'-' key.

MoveEnd

val MoveEndKey

End Movement key.

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

MoveHome

val MoveHomeKey

Home Movement key.

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

Muhenkan

val MuhenkanKey

Japanese non-conversion key.

Multiply

val MultiplyKey

'*' key.

Music

val MusicKey

Music special function key.

Used to launch a music player application.

N

val NKey

'N' key.

val NavigateInKey

Navigate in key.

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

val NavigateNextKey

Navigate to next key.

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

val NavigateOutKey

Navigate out key.

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

val NavigatePreviousKey

Navigate to previous key.

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

Nine

val NineKey

'9' key.

Notification

val NotificationKey

Notification key.

NumLock

val NumLockKey

Num Lock key.

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

NumPad0

val NumPad0Key

Numeric keypad '0' key.

NumPad1

val NumPad1Key

Numeric keypad '1' key.

NumPad2

val NumPad2Key

Numeric keypad '2' key.

NumPad3

val NumPad3Key

Numeric keypad '3' key.

NumPad4

val NumPad4Key

Numeric keypad '4' key.

NumPad5

val NumPad5Key

Numeric keypad '5' key.

NumPad6

val NumPad6Key

Numeric keypad '6' key.

NumPad7

val NumPad7Key

Numeric keypad '7' key.

NumPad8

val NumPad8Key

Numeric keypad '8' key.

NumPad9

val NumPad9Key

Numeric keypad '9' key.

NumPadAdd

val NumPadAddKey

Numeric keypad '+' key (for addition).

NumPadComma

val NumPadCommaKey

Numeric keypad ',' key (for decimals or digit grouping).

NumPadDivide

val NumPadDivideKey

Numeric keypad '/' key (for division).

NumPadDot

val NumPadDotKey

Numeric keypad '.' key (for decimals or digit grouping).

NumPadEnter

val NumPadEnterKey

Numeric keypad Enter key.

NumPadEquals

val NumPadEqualsKey

Numeric keypad '=' key.

NumPadLeftParenthesis

val NumPadLeftParenthesisKey

Numeric keypad '(' key.

NumPadMultiply

val NumPadMultiplyKey

Numeric keypad '*' key (for multiplication).

NumPadRightParenthesis

val NumPadRightParenthesisKey

Numeric keypad ')' key.

NumPadSubtract

val NumPadSubtractKey

Numeric keypad '-' key (for subtraction).

Number

val NumberKey

Number modifier key.

Used to enter numeric symbols. This key is not Num Lock; it is more like AltLeft.

O

val OKey

'O' key.

One

val OneKey

'1' key.

P

val PKey

'P' key.

PageDown

val PageDownKey

Page Down key.

PageUp

val PageUpKey

Page Up key.

Pairing

val PairingKey

Pairing key.

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

Paste

val PasteKey

Paste key.

Period

val PeriodKey

'.' key.

PictureSymbols

val PictureSymbolsKey

Picture Symbols modifier key.

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

Plus

val PlusKey

'+' key.

Pound

val PoundKey

'#' key.

Power

val PowerKey

Power key.

PrintScreen

val PrintScreenKey

System Request / Print Screen key.

ProfileSwitch

val ProfileSwitchKey

Used to switch current android.accounts.Account that is consuming content. May be consumed by system to set account globally.

ProgramBlue

val ProgramBlueKey

Blue "programmable" key.

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

ProgramGreen

val ProgramGreenKey

Green "programmable" key.

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

ProgramRed

val ProgramRedKey

Red "programmable" key.

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

ProgramYellow

val ProgramYellowKey

Yellow "programmable" key.

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

Q

val QKey

'Q' key.

R

val RKey

'R' key.

Refresh

val RefreshKey

Refresh key.

RightBracket

val RightBracketKey

']' key.

Ro

val RoKey

Japanese Ro key.

S

val SKey

'S' key.

ScrollLock

val ScrollLockKey

Scroll Lock key.

Search

val SearchKey

Search key.

Semicolon

val SemicolonKey

';' key.

SetTopBoxInput

val SetTopBoxInputKey

Set-top-box input key.

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

SetTopBoxPower

val SetTopBoxPowerKey

Set-top-box power key.

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

Settings

val SettingsKey

Settings key.

Starts the system settings activity.

Seven

val SevenKey

'7' key.

ShiftLeft

val ShiftLeftKey

Left Shift modifier key.

ShiftRight

val ShiftRightKey

Right Shift modifier key.

Six

val SixKey

'6' key.

Slash

val SlashKey

'/' key.

Sleep

val SleepKey

Sleep key.

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

SoftLeft

val SoftLeftKey

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.

SoftRight

val SoftRightKey

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.

SoftSleep

val SoftSleepKey

Put device to sleep unless a wakelock is held.

Spacebar

val SpacebarKey

Space key.

Stem1

val Stem1Key

Generic stem key 1 for Wearables.

Stem2

val Stem2Key

Generic stem key 2 for Wearables.

Stem3

val Stem3Key

Generic stem key 3 for Wearables.

StemPrimary

val StemPrimaryKey

Primary stem key for Wearables.

Main power/reset button.

SwitchCharset

val SwitchCharsetKey

Switch Charset modifier key.

Used to switch character sets (Kanji, Katakana).

Symbol

val SymbolKey

Symbol modifier key.

Used to enter alternate symbols.

SystemNavigationDown

val SystemNavigationDownKey

Consumed by the system for navigation down.

SystemNavigationLeft

val SystemNavigationLeftKey

Consumed by the system for navigation left.

SystemNavigationRight

val SystemNavigationRightKey

Consumed by the system for navigation right.

SystemNavigationUp

val SystemNavigationUpKey

Consumed by the system for navigation up.

T

val TKey

'T' key.

Tab

val TabKey

Tab key.

Three

val ThreeKey

'3' key.

ThumbsDown

val ThumbsDownKey

Thumbs down key. Apps can use this to let user down-vote content.

ThumbsUp

val ThumbsUpKey

Thumbs up key. Apps can use this to let user up-vote content.

Toggle2D3D

val Toggle2D3DKey

3D Mode key.

Toggles the display between 2D and 3D mode.

Tv

val TvKey

TV key.

On TV remotes, switches to viewing live TV.

TvAntennaCable

val TvAntennaCableKey

Antenna/Cable key.

Toggles broadcast input source between antenna and cable.

TvAudioDescription

val TvAudioDescriptionKey

Audio description key.

Toggles audio description off / on.

TvAudioDescriptionMixingVolumeDown

val TvAudioDescriptionMixingVolumeDownKey

Audio description mixing volume down key.

Lessen audio description volume as compared with normal audio volume.

TvAudioDescriptionMixingVolumeUp

val TvAudioDescriptionMixingVolumeUpKey

Audio description mixing volume up key.

Increase the audio description volume as compared with normal audio volume.

TvContentsMenu

val TvContentsMenuKey

Contents menu key.

Goes to the title list. Corresponds to Contents Menu (0x0B) of CEC User Control Code

TvDataService

val TvDataServiceKey

TV data service key.

Displays data services like weather, sports.

TvInput

val TvInputKey

TV input key.

On TV remotes, switches the input on a television screen.

TvInputComponent1

val TvInputComponent1Key

Component #1 key.

Switches to component video input #1.

TvInputComponent2

val TvInputComponent2Key

Component #2 key.

Switches to component video input #2.

TvInputComposite1

val TvInputComposite1Key

Composite #1 key.

Switches to composite video input #1.

TvInputComposite2

val TvInputComposite2Key

Composite #2 key.

Switches to composite video input #2.

TvInputHdmi1

val TvInputHdmi1Key

HDMI #1 key.

Switches to HDMI input #1.

TvInputHdmi2

val TvInputHdmi2Key

HDMI #2 key.

Switches to HDMI input #2.

TvInputHdmi3

val TvInputHdmi3Key

HDMI #3 key.

Switches to HDMI input #3.

TvInputHdmi4

val TvInputHdmi4Key

HDMI #4 key.

Switches to HDMI input #4.

TvInputVga1

val TvInputVga1Key

VGA #1 key.

Switches to VGA (analog RGB) input #1.

TvMediaContextMenu

val TvMediaContextMenuKey

Media context menu key.

Goes to the context menu of media contents. Corresponds to Media Context-sensitive Menu (0x11) of CEC User Control Code.

TvNetwork

val TvNetworkKey

Toggle Network key.

Toggles selecting broadcast services.

TvNumberEntry

val TvNumberEntryKey

Number entry key.

Initiates to enter multi-digit channel number when each digit key is assigned for selecting separate channel. Corresponds to Number Entry Mode (0x1D) of CEC User Control Code.

TvPower

val TvPowerKey

TV power key.

On TV remotes, toggles the power on a television screen.

TvRadioService

val TvRadioServiceKey

Radio key.

Toggles TV service / Radio service.

TvSatellite

val TvSatelliteKey

Satellite key.

Switches to digital satellite broadcast service.

TvSatelliteBs

val TvSatelliteBsKey

BS key.

Switches to BS digital satellite broadcasting service available in Japan.

TvSatelliteCs

val TvSatelliteCsKey

CS key.

Switches to CS digital satellite broadcasting service available in Japan.

TvSatelliteService

val TvSatelliteServiceKey

BS/CS key.

Toggles between BS and CS digital satellite services.

TvTeletext

val TvTeletextKey

Teletext key.

Displays Teletext service.

TvTerrestrialAnalog

val TvTerrestrialAnalogKey

Analog Terrestrial key.

Switches to analog terrestrial broadcast service.

TvTerrestrialDigital

val TvTerrestrialDigitalKey

Digital Terrestrial key.

Switches to digital terrestrial broadcast service.

TvTimerProgramming

val TvTimerProgrammingKey

Timer programming key.

Goes to the timer recording menu. Corresponds to Timer Programming (0x54) of CEC User Control Code.

TvZoomMode

val TvZoomModeKey

Zoom mode key.

Changes Zoom mode (Normal, Full, Zoom, Wide-zoom, etc.)

Two

val TwoKey

'2' key.

U

val UKey

'U' key.

Unknown

val UnknownKey

Unknown key.

V

val VKey

'V' key.

VoiceAssist

val VoiceAssistKey

Voice Assist key.

Launches the global voice assist activity. Not delivered to applications.

VolumeDown

val VolumeDownKey

Volume Down key.

Adjusts the speaker volume down.

VolumeMute

val VolumeMuteKey

Volume Mute key.

Mutes the speaker, unlike MicrophoneMute.

This key should normally be implemented as a toggle such that the first press mutes the speaker and the second press restores the original volume.

VolumeUp

val VolumeUpKey

Volume Up key.

Adjusts the speaker volume up.

W

val WKey

'W' key.

WakeUp

val WakeUpKey

Wakeup key.

Wakes up the device. Behaves somewhat like Power but it has no effect if the device is already awake.

Window

val WindowKey

Window key.

On TV remotes, toggles picture-in-picture mode or other windowing functions. On Android Wear devices, triggers a display offset.

X

val XKey

'X' key.

Y

val YKey

'Y' key.

Yen

val YenKey

Japanese Yen key.

Z

val ZKey

'Z' key.

ZenkakuHankaru

val ZenkakuHankaruKey

Japanese full-width / half-width key.

Zero

val ZeroKey

'0' key.

ZoomIn

val ZoomInKey

Zoom in key.

ZoomOut

val ZoomOutKey

Zoom out key.

Public constructors

Key

Key(keyCode: Long)
Parameters
keyCode: Long

an integer code representing the key pressed.

Key

Key(keyCode: Long)
Parameters
keyCode: Long

a Long value representing the key pressed. Note: This keycode can be used to uniquely identify a hardware key. It is different from the native keycode.

Public functions

toString

open fun toString(): String

Public properties

keyCode

val keyCodeLong

an integer code representing the key pressed.

keyCode

val keyCodeLong

a Long value representing the key pressed. Note: This keycode can be used to uniquely identify a hardware key. It is different from the native keycode.

Extension properties

nativeKeyCode

val Key.nativeKeyCodeInt

The native keycode corresponding to this Key.