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

This property is deprecated. `Key.Home` is never delivered to applications.

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 Delete Key.

Cmn
android
Key

Numeric keypad Down Arrow Key.

Cmn
android
Key

Numeric keypad Left Arrow Key.

Cmn
android
Key

Numeric keypad Right Arrow Key.

Cmn
android
Key

Numeric keypad Up Arrow Key.

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 Insert Key.

Cmn
android
Key

Numeric keypad '(' key.

Cmn
android
Key

Numeric keypad End Key.

Cmn
android
Key

Numeric keypad Home Key.

Cmn
android
Key

Numeric keypad '*' key (for multiplication).

Cmn
android
Key

Numeric keypad Page Down Key.

Cmn
android
Key

Numeric keypad Page Up Key.

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

System Home 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)
Cmn
android

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 A: Key

'A' key.

AllApps

val AllApps: Key

Show all apps.

AltLeft

val AltLeft: Key

Left Alt modifier key.

AltRight

val AltRight: Key

Right Alt modifier key.

Apostrophe

val Apostrophe: Key

''' (apostrophe) key.

AppSwitch

val AppSwitch: Key

App switch key.

Should bring up the application switcher dialog.

Assist

val Assist: Key

Assist key.

Launches the global assist activity. Not delivered to applications.

At

val At: Key

'@' key.

AvReceiverInput

val AvReceiverInput: Key

A/V Receiver input key.

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

AvReceiverPower

val AvReceiverPower: Key

A/V Receiver power key.

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

B

val B: Key

'B' key.

Back

val Back: Key

Back key.

Backslash

val Backslash: Key

'\' key.

Backspace

val Backspace: Key

Backspace key.

Deletes characters before the insertion point, unlike Delete.

Bookmark

val Bookmark: Key

Bookmark key.

On some TV remotes, bookmarks content or web pages.

Break

val Break: Key

Break / Pause key.

BrightnessDown

val BrightnessDown: Key

Brightness Down key.

Adjusts the screen brightness down.

BrightnessUp

val BrightnessUp: Key

Brightness Up key.

Adjusts the screen brightness up.

Browser

val Browser: Key

Browser special function key.

Used to launch a browser application.

Button1

val Button1: Key

Generic Game Pad Button #1.

Button10

val Button10: Key

Generic Game Pad Button #10.

Button11

val Button11: Key

Generic Game Pad Button #11.

Button12

val Button12: Key

Generic Game Pad Button #12.

Button13

val Button13: Key

Generic Game Pad Button #13.

Button14

val Button14: Key

Generic Game Pad Button #14.

Button15

val Button15: Key

Generic Game Pad Button #15.

Button16

val Button16: Key

Generic Game Pad Button #16.

Button2

val Button2: Key

Generic Game Pad Button #2.

Button3

val Button3: Key

Generic Game Pad Button #3.

Button4

val Button4: Key

Generic Game Pad Button #4.

Button5

val Button5: Key

Generic Game Pad Button #5.

Button6

val Button6: Key

Generic Game Pad Button #6.

Button7

val Button7: Key

Generic Game Pad Button #7.

Button8

val Button8: Key

Generic Game Pad Button #8.

Button9

val Button9: Key

Generic Game Pad Button #9.

ButtonA

val ButtonA: Key

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 ButtonB: Key

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 ButtonC: Key

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 ButtonL1: Key

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 ButtonL2: Key

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 ButtonMode: Key

Mode Button key.

On a game controller, the button labeled Mode.

ButtonR1

val ButtonR1: Key

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 ButtonR2: Key

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 ButtonSelect: Key

Select Button key.

On a game controller, the button labeled Select.

ButtonStart

val ButtonStart: Key

Start Button key.

On a game controller, the button labeled Start.

ButtonThumbLeft

val ButtonThumbLeft: Key

Left Thumb Button key.

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

ButtonThumbRight

val ButtonThumbRight: Key

Right Thumb Button key.

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

ButtonX

val ButtonX: Key

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 ButtonY: Key

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 ButtonZ: Key

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 C: Key

'C' key.

Calculator

val Calculator: Key

Calculator special function key.

Used to launch a calculator application.

Calendar

val Calendar: Key

Calendar special function key.

Used to launch a calendar application.

Call

val Call: Key

Call key.

Camera

val Camera: Key

Camera key.

Used to launch a camera application or take pictures.

CapsLock

val CapsLock: Key

Caps Lock key.

Captions

val Captions: Key

Toggle captions key.

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

ChannelDown

val ChannelDown: Key

Channel down key.

On TV remotes, decrements the television channel.

ChannelUp

val ChannelUp: Key

Channel up key.

On TV remotes, increments the television channel.

Clear

val Clear: Key

Clear key.

Comma

val Comma: Key

',' key.

Contacts

val Contacts: Key

Contacts special function key.

Used to launch an address book application.

Copy

val Copy: Key

Copy key.

CtrlLeft

val CtrlLeft: Key

Left Control modifier key.

CtrlRight

val CtrlRight: Key

Right Control modifier key.

Cut

val Cut: Key

Cut key.

D

val D: Key

'D' key.

Delete

val Delete: Key

Delete key.

Deletes characters ahead of the insertion point, unlike Backspace.

DirectionCenter

val DirectionCenter: Key

Center Arrow Key / Directional Pad Center key.

May also be synthesized from trackball motions.

DirectionDown

val DirectionDown: Key

Down Arrow Key / Directional Pad Down key.

May also be synthesized from trackball motions.

DirectionDownLeft

val DirectionDownLeft: Key

Directional Pad Down-Left.

DirectionDownRight

val DirectionDownRight: Key

Directional Pad Down-Right.

DirectionLeft

val DirectionLeft: Key

Left Arrow Key / Directional Pad Left key.

May also be synthesized from trackball motions.

DirectionRight

val DirectionRight: Key

Right Arrow Key / Directional Pad Right key.

May also be synthesized from trackball motions.

DirectionUp

val DirectionUp: Key

Up Arrow Key / Directional Pad Up key.

May also be synthesized from trackball motions.

DirectionUpLeft

val DirectionUpLeft: Key

Directional Pad Up-Left.

DirectionUpRight

val DirectionUpRight: Key

Directional Pad Up-Right.

Dvr

val Dvr: Key

DVR key.

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

E

val E: Key

'E' key.

Eight

val Eight: Key

'8' key.

Eisu

val Eisu: Key

Japanese alphanumeric key.

EndCall

val EndCall: Key

End Call key.

Enter

val Enter: Key

Enter key.

Envelope

val Envelope: Key

Envelope special function key.

Used to launch a mail application.

Equals

val Equals: Key

'=' key.

Escape

val Escape: Key

Escape key.

F

val F: Key

'F' key.

F1

val F1: Key

F1 key.

F10

val F10: Key

F10 key.

F11

val F11: Key

F11 key.

F12

val F12: Key

F12 key.

F2

val F2: Key

F2 key.

F3

val F3: Key

F3 key.

F4

val F4: Key

F4 key.

F5

val F5: Key

F5 key.

F6

val F6: Key

F6 key.

F7

val F7: Key

F7 key.

F8

val F8: Key

F8 key.

F9

val F9: Key

F9 key.

Five

val Five: Key

'5' key.

Focus

val Focus: Key

Camera Focus key.

Used to focus the camera.

Forward

val Forward: Key

Forward key.

Navigates forward in the history stack. Complement of Back.

Four

val Four: Key

'4' key.

Function

val Function: Key

Function modifier key.

G

val G: Key

'G' key.

Grave

val Grave: Key

'`' (backtick) key.

Guide

val Guide: Key

Guide key.

On TV remotes, shows a programming guide.

H

val H: Key

'H' key.

HeadsetHook

val HeadsetHook: Key

Headset Hook key.

Used to hang up calls and stop media.

Help

val Help: Key

Help key.

Henkan

val Henkan: Key

Japanese conversion key.

Home

val Home: Key

System Home key.

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

I

val I: Key

'I' key.

Info

val Info: Key

Info key.

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

Insert

val Insert: Key

Insert key.

Toggles insert / overwrite edit mode.

J

val J: Key

'J' key.

K

val K: Key

'K' key.

Kana

val Kana: Key

Japanese kana key.

KatakanaHiragana

val KatakanaHiragana: Key

Japanese katakana / hiragana key.

L

val L: Key

'L' key.

LanguageSwitch

val LanguageSwitch: Key

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 LastChannel: Key

Last Channel key.

Goes to the last viewed channel.

LeftBracket

val LeftBracket: Key

'[' key.

M

val M: Key

'M' key.

MannerMode

val MannerMode: Key

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 MediaAudioTrack: Key

Audio Track key.

Switches the audio tracks.

MediaClose

val MediaClose: Key

Close media key.

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

MediaEject

val MediaEject: Key

Eject media key.

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

MediaFastForward

val MediaFastForward: Key

Fast Forward media key.

MediaNext

val MediaNext: Key

Play Next media key.

MediaPause

val MediaPause: Key

Pause media key.

MediaPlay

val MediaPlay: Key

Play media key.

MediaPlayPause

val MediaPlayPause: Key

Play/Pause media key.

MediaPrevious

val MediaPrevious: Key

Play Previous media key.

MediaRecord

val MediaRecord: Key

Record media key.

MediaRewind

val MediaRewind: Key

Rewind media key.

MediaSkipBackward

val MediaSkipBackward: Key

Skip backward media key.

MediaSkipForward

val MediaSkipForward: Key

Skip forward media key.

MediaStepBackward

val MediaStepBackward: Key

Step backward media key.

Steps media backward, one frame at a time.

MediaStepForward

val MediaStepForward: Key

Step forward media key.

Steps media forward, one frame at a time.

MediaStop

val MediaStop: Key

Stop media key.

MediaTopMenu

val MediaTopMenu: Key

Media Top Menu key.

Goes to the top of media menu.

val Menu: Key

Menu key.

MetaLeft

val MetaLeft: Key

Left Meta modifier key.

MetaRight

val MetaRight: Key

Right Meta modifier key.

MicrophoneMute

val MicrophoneMute: Key

Mute key.

Mutes the microphone, unlike VolumeMute.

Minus

val Minus: Key

'-' key.

MoveEnd

val MoveEnd: Key

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 MoveHome: Key

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 Muhenkan: Key

Japanese non-conversion key.

Multiply

val Multiply: Key

'*' key.

Music

val Music: Key

Music special function key.

Used to launch a music player application.

N

val N: Key

'N' key.

val NavigateIn: Key

Navigate in key.

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

val NavigateNext: Key

Navigate to next key.

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

val NavigateOut: Key

Navigate out key.

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

val NavigatePrevious: Key

Navigate to previous key.

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

Nine

val Nine: Key

'9' key.

Notification

val Notification: Key

Notification key.

NumLock

val NumLock: Key

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 NumPad0: Key

Numeric keypad '0' key.

NumPad1

val NumPad1: Key

Numeric keypad '1' key.

NumPad2

val NumPad2: Key

Numeric keypad '2' key.

NumPad3

val NumPad3: Key

Numeric keypad '3' key.

NumPad4

val NumPad4: Key

Numeric keypad '4' key.

NumPad5

val NumPad5: Key

Numeric keypad '5' key.

NumPad6

val NumPad6: Key

Numeric keypad '6' key.

NumPad7

val NumPad7: Key

Numeric keypad '7' key.

NumPad8

val NumPad8: Key

Numeric keypad '8' key.

NumPad9

val NumPad9: Key

Numeric keypad '9' key.

NumPadAdd

val NumPadAdd: Key

Numeric keypad '+' key (for addition).

NumPadComma

val NumPadComma: Key

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

NumPadDelete

val NumPadDelete: Key

Numeric keypad Delete Key.

NumPadDirectionDown

val NumPadDirectionDown: Key

Numeric keypad Down Arrow Key.

NumPadDirectionLeft

val NumPadDirectionLeft: Key

Numeric keypad Left Arrow Key.

NumPadDirectionRight

val NumPadDirectionRight: Key

Numeric keypad Right Arrow Key.

NumPadDirectionUp

val NumPadDirectionUp: Key

Numeric keypad Up Arrow Key.

NumPadDivide

val NumPadDivide: Key

Numeric keypad '/' key (for division).

NumPadDot

val NumPadDot: Key

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

NumPadEnter

val NumPadEnter: Key

Numeric keypad Enter key.

NumPadEquals

val NumPadEquals: Key

Numeric keypad '=' key.

NumPadInsert

val NumPadInsert: Key

Numeric keypad Insert Key.

NumPadLeftParenthesis

val NumPadLeftParenthesis: Key

Numeric keypad '(' key.

NumPadMoveEnd

val NumPadMoveEnd: Key

Numeric keypad End Key.

NumPadMoveHome

val NumPadMoveHome: Key

Numeric keypad Home Key.

NumPadMultiply

val NumPadMultiply: Key

Numeric keypad '*' key (for multiplication).

NumPadPageDown

val NumPadPageDown: Key

Numeric keypad Page Down Key.

NumPadPageUp

val NumPadPageUp: Key

Numeric keypad Page Up Key.

NumPadRightParenthesis

val NumPadRightParenthesis: Key

Numeric keypad ')' key.

NumPadSubtract

val NumPadSubtract: Key

Numeric keypad '-' key (for subtraction).

Number

val Number: Key

Number modifier key.

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

O

val O: Key

'O' key.

One

val One: Key

'1' key.

P

val P: Key

'P' key.

PageDown

val PageDown: Key

Page Down key.

PageUp

val PageUp: Key

Page Up key.

Pairing

val Pairing: Key

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 Paste: Key

Paste key.

Period

val Period: Key

'.' key.

PictureSymbols

val PictureSymbols: Key

Picture Symbols modifier key.

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

Plus

val Plus: Key

'+' key.

Pound

val Pound: Key

'#' key.

Power

val Power: Key

Power key.

PrintScreen

val PrintScreen: Key

System Request / Print Screen key.

ProfileSwitch

val ProfileSwitch: Key

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

ProgramBlue

val ProgramBlue: Key

Blue "programmable" key.

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

ProgramGreen

val ProgramGreen: Key

Green "programmable" key.

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

ProgramRed

val ProgramRed: Key

Red "programmable" key.

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

ProgramYellow

val ProgramYellow: Key

Yellow "programmable" key.

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

Q

val Q: Key

'Q' key.

R

val R: Key

'R' key.

Refresh

val Refresh: Key

Refresh key.

RightBracket

val RightBracket: Key

']' key.

Ro

val Ro: Key

Japanese Ro key.

S

val S: Key

'S' key.

ScrollLock

val ScrollLock: Key

Scroll Lock key.

Search

val Search: Key

Search key.

Semicolon

val Semicolon: Key

';' key.

SetTopBoxInput

val SetTopBoxInput: Key

Set-top-box input key.

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

SetTopBoxPower

val SetTopBoxPower: Key

Set-top-box power key.

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

Settings

val Settings: Key

Settings key.

Starts the system settings activity.

Seven

val Seven: Key

'7' key.

ShiftLeft

val ShiftLeft: Key

Left Shift modifier key.

ShiftRight

val ShiftRight: Key

Right Shift modifier key.

Six

val Six: Key

'6' key.

Slash

val Slash: Key

'/' key.

Sleep

val Sleep: Key

Sleep key.

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

SoftLeft

val SoftLeft: Key

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 SoftRight: Key

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 SoftSleep: Key

Put device to sleep unless a wakelock is held.

Spacebar

val Spacebar: Key

Space key.

Stem1

val Stem1: Key

Generic stem key 1 for Wearables.

Stem2

val Stem2: Key

Generic stem key 2 for Wearables.

Stem3

val Stem3: Key

Generic stem key 3 for Wearables.

StemPrimary

val StemPrimary: Key

Primary stem key for Wearables.

Main power/reset button.

SwitchCharset

val SwitchCharset: Key

Switch Charset modifier key.

Used to switch character sets (Kanji, Katakana).

Symbol

val Symbol: Key

Symbol modifier key.

Used to enter alternate symbols.

SystemHome

val SystemHome: Key

System Home key.

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

SystemNavigationDown

val SystemNavigationDown: Key

Consumed by the system for navigation down.

SystemNavigationLeft

val SystemNavigationLeft: Key

Consumed by the system for navigation left.

SystemNavigationRight

val SystemNavigationRight: Key

Consumed by the system for navigation right.

SystemNavigationUp

val SystemNavigationUp: Key

Consumed by the system for navigation up.

T

val T: Key

'T' key.

Tab

val Tab: Key

Tab key.

Three

val Three: Key

'3' key.

ThumbsDown

val ThumbsDown: Key

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

ThumbsUp

val ThumbsUp: Key

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

Toggle2D3D

val Toggle2D3D: Key

3D Mode key.

Toggles the display between 2D and 3D mode.

Tv

val Tv: Key

TV key.

On TV remotes, switches to viewing live TV.

TvAntennaCable

val TvAntennaCable: Key

Antenna/Cable key.

Toggles broadcast input source between antenna and cable.

TvAudioDescription

val TvAudioDescription: Key

Audio description key.

Toggles audio description off / on.

TvAudioDescriptionMixingVolumeDown

val TvAudioDescriptionMixingVolumeDown: Key

Audio description mixing volume down key.

Lessen audio description volume as compared with normal audio volume.

TvAudioDescriptionMixingVolumeUp

val TvAudioDescriptionMixingVolumeUp: Key

Audio description mixing volume up key.

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

TvContentsMenu

val TvContentsMenu: Key

Contents menu key.

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

TvDataService

val TvDataService: Key

TV data service key.

Displays data services like weather, sports.

TvInput

val TvInput: Key

TV input key.

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

TvInputComponent1

val TvInputComponent1: Key

Component #1 key.

Switches to component video input #1.

TvInputComponent2

val TvInputComponent2: Key

Component #2 key.

Switches to component video input #2.

TvInputComposite1

val TvInputComposite1: Key

Composite #1 key.

Switches to composite video input #1.

TvInputComposite2

val TvInputComposite2: Key

Composite #2 key.

Switches to composite video input #2.

TvInputHdmi1

val TvInputHdmi1: Key

HDMI #1 key.

Switches to HDMI input #1.

TvInputHdmi2

val TvInputHdmi2: Key

HDMI #2 key.

Switches to HDMI input #2.

TvInputHdmi3

val TvInputHdmi3: Key

HDMI #3 key.

Switches to HDMI input #3.

TvInputHdmi4

val TvInputHdmi4: Key

HDMI #4 key.

Switches to HDMI input #4.

TvInputVga1

val TvInputVga1: Key

VGA #1 key.

Switches to VGA (analog RGB) input #1.

TvMediaContextMenu

val TvMediaContextMenu: Key

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 TvNetwork: Key

Toggle Network key.

Toggles selecting broadcast services.

TvNumberEntry

val TvNumberEntry: Key

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 TvPower: Key

TV power key.

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

TvRadioService

val TvRadioService: Key

Radio key.

Toggles TV service / Radio service.

TvSatellite

val TvSatellite: Key

Satellite key.

Switches to digital satellite broadcast service.

TvSatelliteBs

val TvSatelliteBs: Key

BS key.

Switches to BS digital satellite broadcasting service available in Japan.

TvSatelliteCs

val TvSatelliteCs: Key

CS key.

Switches to CS digital satellite broadcasting service available in Japan.

TvSatelliteService

val TvSatelliteService: Key

BS/CS key.

Toggles between BS and CS digital satellite services.

TvTeletext

val TvTeletext: Key

Teletext key.

Displays Teletext service.

TvTerrestrialAnalog

val TvTerrestrialAnalog: Key

Analog Terrestrial key.

Switches to analog terrestrial broadcast service.

TvTerrestrialDigital

val TvTerrestrialDigital: Key

Digital Terrestrial key.

Switches to digital terrestrial broadcast service.

TvTimerProgramming

val TvTimerProgramming: Key

Timer programming key.

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

TvZoomMode

val TvZoomMode: Key

Zoom mode key.

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

Two

val Two: Key

'2' key.

U

val U: Key

'U' key.

Unknown

val Unknown: Key

Unknown key.

V

val V: Key

'V' key.

VoiceAssist

val VoiceAssist: Key

Voice Assist key.

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

VolumeDown

val VolumeDown: Key

Volume Down key.

Adjusts the speaker volume down.

VolumeMute

val VolumeMute: Key

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 VolumeUp: Key

Volume Up key.

Adjusts the speaker volume up.

W

val W: Key

'W' key.

WakeUp

val WakeUp: Key

Wakeup key.

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

Window

val Window: Key

Window key.

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

X

val X: Key

'X' key.

Y

val Y: Key

'Y' key.

Yen

val Yen: Key

Japanese Yen key.

Z

val Z: Key

'Z' key.

ZenkakuHankaru

val ZenkakuHankaru: Key

Japanese full-width / half-width key.

Zero

val Zero: Key

'0' key.

ZoomIn

val ZoomIn: Key

Zoom in key.

ZoomOut

val ZoomOut: Key

Zoom out key.

Public constructors

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 keyCode: Long

an integer code representing the key pressed.

keyCode

val 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.

Extension properties

Key.nativeKeyCode

val Key.nativeKeyCode: Int

The native keycode corresponding to this Key.