1. Introduction
This document specifies the values that should be used in the KeyboardEvent
.key
attribute to encode the key’s
meaning. The key
value will differ based on the user’s
current locale. For a key value that is based only on the key’s physical
location and does not vary based on locale, see code
described in [UIEvents-Code].
This specification was formerly titled DOM Level 3 KeyboardEvent key
Values.
1.1. Stylistic Conventions
This specification uses the following conventions:
-
The key cap printed on a key is shown as
↓
,=
orQ
. This is used to refer to a key from the user’s perspective without regard for thekey
andcode
values in the generatedKeyboardEvent
. -
Glyphs representing character are shown as:
"𣧂"
. -
Unicode character encodings are shown as:
\u003d
. -
Names of key values generated by a key press (i.e., the value of
KeyboardEvent
.key
) are shown as:"ArrowDown"
,"="
,"q"
or"Q"
. -
Names of key codes associated with the physical keys (i.e., the value of
KeyboardEvent
.code
) are shown as:"ArrowDown"
,"Equal"
or"KeyQ"
.
2. Keyboard Event key
Value Tables
This document defines the list of KeyboardEvent
.key
values which implementations MUST support, at a minimum, in addition to
support for the full range of Unicode [Unicode] codepoints. The key
attribute of an event MUST always contain one of these
control key or character values (even if the value is "Unidentified"
). If the key represents one of the set of printable control characters which has
a Unicode character entry, such as the tab key, the key
attribute MUST have the key value (e.g., "Tab"
).
Implementations that are unable to identify a key MUST use the key value "Unidentified"
.
Conforming implementations MUST only use "Unidentified"
as a key value when there is no way for the implementation to detect the key value.
Exposing only this value MUST NOT indicate a conforming implementation.
The key values defined in this specification are based in part on the sets of keycodes from
the java.awt.event.KeyEvent
interface of the Java Platform,
Standard Edition 6 API Specification [KeyEventJava], and the System.Windows.Forms.Keys
key enumeration of the Microsoft .NET
Framework 4.0 Class Library [KeysNet]. Additional information in this spec
comes from Microsoft’s WM_APPCOMMAND messages [WmAppCommand], and other
more specialized specifications as noted in this document.
The keys on the numeric keypad (e.g., the keypad 1
key) do not generate distinct key
values from their non-keypad
counterparts (e.g., the 1
key in the main part of the keyboard). The location
attribute can be used to determine if a key
originated from the numeric keypad.
\uD84E\uDDC2
for "𣧂"
, a Chinese character meaning untidy), rather than C-style fixed-length characters (
\U000239c2
for "𣧂"
) or delimited escapes such as Numeric Character References
("𣧂"
). Characters escaped in this manner:
-
are based on UTF-16 encoding, in that it uses surrogate pairs for values outside the Basic Multilingual Plane
-
are expressed using surrogate pairs, which makes it difficult for a human to look up the value, and might require unnecessary overhead for machine processing — this can also cause problems with software written in the incorrect belief that Unicode is a 16-bit character set
-
are problematic for characters on supplementary planes (emoji, or Chinese characters on plane 2), some of which are expected to be input using a keyboard
-
are not be suitable for Java or C, which use different escaping mechanisms (could be solved with a normalizing method)
The following sub-sections contain the normative list of case-sensitive key
values, their character values (where applicable), an informative
description of typical usage, and an informative categorization. A
conforming implementation of the KeyboardEvent
interface MUST support at
least this set of values for use in the key
attributes,
though not all values MAY be available on all platforms or devices.
Future versions of this specification MAY include key values not included here, which have become common since the publication of this specification.
2.1. Special Key Values
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"Unidentified"
| This key value is used when an implementation is unable to identify another key value, due to either hardware, platform, or software constraints. |
2.2. Modifier Keys
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"Alt"
| The Alt (Alternative) key.This key enables the alternate modifier function for interpreting concurrent or subsequent keyboard input. This key value is also used for the Apple Option key.
|
"AltGraph"
| The Alternate Graphics (AltGr or AltGraph ) key. This key is used enable the ISO Level 3 shift modifier (the standard Shift key is the level 2 modifier). See [ISO9995-1].
|
"CapsLock"
| The Caps Lock (Capital) key. Toggle capital character lock function for interpreting subsequent keyboard input event.
|
"Control"
| The Control or Ctrl key, to enable control modifier function for interpreting concurrent or subsequent keyboard input.
|
"Fn"
| The Function switch Fn key.Activating this key simultaneously with another key changes that key’s value to an alternate character or function. This key is often handled directly in the keyboard hardware and does not usually generate key events. |
"FnLock"
| The Function-Lock (FnLock or F-Lock ) key. Activating this key switches the mode of the keyboard to changes some keys' values to an alternate character or function.
This key is often handled directly in the keyboard hardware and does not usually generate key events.
|
"Hyper"
| The Hyper key.
|
"Meta"
| The Meta key, to enable meta modifier function for interpreting concurrent or subsequent keyboard input. This key value is used for the Windows Logokey and the Apple Command or ⌘ key.
|
"NumLock"
| The NumLock or Number Lock key, to toggle numer-pad mode function for interpreting subsequent keyboard input.
|
"ScrollLock"
| The Scroll Lock key, to toggle between scrolling and cursor movement modes.
|
"Shift"
| The Shift key, to enable shift modifier function for interpreting concurrent or subsequent keyboard input.
|
"Super"
| The Super key.
|
"Symbol"
| The Symbol modifier key (used on some virtual keyboards). |
"SymbolLock"
| The Symbol Lock key. |
2.3. Whitespace Keys
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"Enter"
| The Enter or ↵ key, to activate current selection or accept current input.This key value is also used for the Return (Macintosh numpad) key.This key value is also used for the Android KEYCODE_DPAD_CENTER .
|
"Tab"
| The Horizontal Tabulation Tab key.
|
The space or spacebar key is encoded as " "
.
2.4. Navigation Keys
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"ArrowDown"
| The down arrow key, to navigate or traverse downward. (KEYCODE_DPAD_DOWN )
|
"ArrowLeft"
| The left arrow key, to navigate or traverse leftward. (KEYCODE_DPAD_LEFT )
|
"ArrowRight"
| The right arrow key, to navigate or traverse rightward. (KEYCODE_DPAD_RIGHT )
|
"ArrowUp"
| The up arrow key, to navigate or traverse upward. (KEYCODE_DPAD_UP )
|
"End"
| The End key, used with keyboard entry to go to the end of content (KEYCODE_MOVE_END ).
|
"Home"
| The Home key, used with keyboard entry, to go to start of content (KEYCODE_MOVE_HOME ).For the mobile phone Home key (which goes to the phone’s main screen), use "GoHome" .
|
"PageDown"
| The Page Down key, to scroll down or display next page of content. |
"PageUp"
| The Page Up key, to scroll up or display previous page of content. |
2.5. Editing Keys
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"Backspace"
| The Backspace key. This key value is also used for the key labeled Delete on MacOS keyboards.
|
"Clear"
| Remove the currently selected input. |
"Copy"
| Copy the current selection. (APPCOMMAND_COPY )
|
"CrSel"
| The Cursor Select (Crsel) key. |
"Cut"
| Cut the current selection. (APPCOMMAND_CUT )
|
"Delete"
| The Delete (Del) Key. This key value is also used for the key labeled Delete on MacOS keyboards when modified by the Fn key.
|
"EraseEof"
| The Erase to End of Field key. This key deletes all characters from the current cursor position to the end of the current field. |
"ExSel"
| The Extend Selection (Exsel) key. |
"Insert"
| The Insert (Ins) key, to toggle between text modes for insertion or overtyping. (KEYCODE_INSERT )
|
"Paste"
| The Paste key. (APPCOMMAND_PASTE )
|
"Redo"
| Redo the last action. (APPCOMMAND_REDO )
|
"Undo"
| Undo the last action. (APPCOMMAND_UNDO )
|
2.6. UI Keys
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"Accept"
| The Accept (Commit, OK) key. Accept current option or input method sequence conversion. |
"Again"
| The Again key, to redo or repeat an action. |
"Attn"
| The Attention (Attn) key. |
"Cancel"
| The Cancel key. |
"ContextMenu"
| Show the application’s context menu. This key is commonly found between the right OS key and the right Control key.
|
"Escape"
| The Escape (Esc) key. This key was originally used to initiate an escape sequence, but is now more generally used to exit or "escape" the current context, such as closing a dialog or exiting full screen mode. |
"Execute"
| The Execute key. |
"Find"
| Open the Find dialog. (APPCOMMAND_FIND )
|
"Help"
| Open a help dialog or toggle display of help information. ( , )
|
"Pause"
|
Pause the current state or application (as appropriate).
Do not use this value for the |
"Play"
|
Play or resume the current state or application (as appropriate).
Do not use this value for the |
"Props"
| The properties (Props) key. |
"Select"
| The Select key. |
"ZoomIn"
| The ZoomIn key. (KEYCODE_ZOOM_IN )
|
"ZoomOut"
| The ZoomOut key. (KEYCODE_ZOOM_OUT )
|
2.7. Device Keys
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"BrightnessDown"
| The Brightness Down key. Typically controls the display brightness. (KEYCODE_BRIGHTNESS_DOWN )
|
"BrightnessUp"
| The Brightness Up key. Typically controls the display brightness. (KEYCODE_BRIGHTNESS_UP )
|
"Eject"
| Toggle removable media to eject (open) and insert (close) state. (KEYCODE_MEDIA_EJECT )
|
"LogOff"
| The LogOff key. |
"Power"
|
Toggle power state. (KEYCODE_POWER )
Some devices might not expose this key to the operating environment. |
"PowerOff"
| The PowerOff key. Sometime called PowerDown .
|
"PrintScreen"
| The Print Screen or SnapShot key, to initiate print-screen function.
|
"Hibernate"
| The Hibernate key. This key saves the current state of the computer to disk so that it can be restored. The computer will then shutdown. |
"Standby"
| The Standby key. This key turns off the display and places the computer into a low-power mode without completely shutting down.
It is sometimes labelled Suspend or Sleep key. ( )
|
"WakeUp"
| The WakeUp key. (KEYCODE_WAKEUP )
|
2.8. IME and Composition Keys
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"AllCandidates"
| The All Candidates key, to initate the multi-candidate mode. |
"Alphanumeric"
| The Alphanumeric key. |
"CodeInput"
| The Code Input key, to initiate the Code Input mode to allow characters to be entered by their code points. |
"Compose"
| The Compose key, also known as Multi_key on the X Window System. This key acts in a manner similar to a dead key, triggering a mode where subsequent key presses are combined to produce a different character. |
"Convert"
| The Convert key, to convert the current input method sequence. |
"Dead"
| A dead key combining key. It may be any combining key from any keyboard layout. For example, on a PC/AT French keyboard, using a French mapping and without any modifier activiated, this is the key value \u0302 COMBINING CIRCUMFLEX ACCENT. In another layout this might be a different unicode combining key.For applications that need to differentiate between specific combining characters, the associated compositionupdate event’s data attribute provides the specific key value. |
"FinalMode"
| The Final Mode Final key used on some Asian keyboards, to enable the final mode for IMEs.
|
"GroupFirst"
| Switch to the first character group. (ISO/IEC 9995) |
"GroupLast"
| Switch to the last character group. (ISO/IEC 9995) |
"GroupNext"
| Switch to the next character group. (ISO/IEC 9995) |
"GroupPrevious"
| Switch to the previous character group. (ISO/IEC 9995) |
"ModeChange"
| The Mode Change key, to toggle between or cycle through input modes of IMEs. |
"NextCandidate"
| The Next Candidate function key. |
"NonConvert"
| The NonConvert ("Don’t Convert") key, to accept current input method sequence without conversion in IMEs. |
"PreviousCandidate"
| The Previous Candidate function key. |
"Process"
| The Process key. |
"SingleCandidate"
| The Single Candidate function key. |
Keys specific to Korean keyboards:
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"HangulMode"
| The Hangul (Korean characters) Mode key, to toggle between Hangul and English modes. |
"HanjaMode"
| The Hanja (Korean characters) Mode key. |
"JunjaMode"
| The Junja (Korean characters) Mode key. |
Keys specific to Japanese keyboards:
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"Eisu"
| The Eisu key. This key may close the IME, but its purpose is defined by the current IME. (KEYCODE_EISU )
|
"Hankaku"
| The (Half-Width) Characters key. |
"Hiragana"
| The Hiragana (Japanese Kana characters) key. |
"HiraganaKatakana"
| The Hiragana/Katakana toggle key. (KEYCODE_KATAKANA_HIRAGANA )
|
"KanaMode"
| The Kana Mode (Kana Lock) key. (KEYCODE_KANA )
|
"KanjiMode"
| The Kanji (Japanese name for ideographic characters of Chinese origin) Mode key. |
"Katakana"
| The Katakana (Japanese Kana characters) key. |
"Romaji"
| The Roman characters function key. |
"Zenkaku"
| The Zenkaku (Full-Width) Characters key. |
"ZenkakuHankaku"
| The Zenkaku/Hankaku (full-width/half-width) toggle key. (KEYCODE_ZENKAKU_HANKAKU )
|
2.9. General-Purpose Function Keys
The exact number of these general purpose function keys varies on different
platforms, and only the first few are defined explicitly here. Additional
function key names are implicitly defined by incrementing the base-10 index at
the end of the function key name. Thus, "F24"
and "Soft8"
are all valid key values.
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"F1"
| The F1 key, a general purpose function key, as index 1. |
"F2"
| The F2 key, a general purpose function key, as index 2. |
"F3"
| The F3 key, a general purpose function key, as index 3. |
"F4"
| The F4 key, a general purpose function key, as index 4. |
"F5"
| The F5 key, a general purpose function key, as index 5. |
"F6"
| The F6 key, a general purpose function key, as index 6. |
"F7"
| The F7 key, a general purpose function key, as index 7. |
"F8"
| The F8 key, a general purpose function key, as index 8. |
"F9"
| The F9 key, a general purpose function key, as index 9. |
"F10"
| The F10 key, a general purpose function key, as index 10. |
"F11"
| The F11 key, a general purpose function key, as index 11. |
"F12"
| The F12 key, a general purpose function key, as index 12. |
"Soft1"
| General purpose virtual function key, as index 1. |
"Soft2"
| General purpose virtual function key, as index 2. |
"Soft3"
| General purpose virtual function key, as index 3. |
"Soft4"
| General purpose virtual function key, as index 4. |
2.10. Multimedia Keys
These are extra keys found on "multimedia" keyboards.
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"ChannelDown"
| Select next (numerically or logically) lower channel. ( , )
|
"ChannelUp"
| Select next (numerically or logically) higher channel. ( , )
|
"Close"
| Close the current document or message (Note: This doesn’t close the application). ( , )
|
"MailForward"
| Open an editor to forward the current message. (APPCOMMAND_FORWARD_MAIL )
|
"MailReply"
| Open an editor to reply to the current message. (APPCOMMAND_REPLY_TO_MAIL )
|
"MailSend"
| Send the current message. (APPCOMMAND_SEND_MAIL )
|
"MediaFastForward"
| Initiate or continue forward playback at faster than normal speed, or increase speed if already fast forwarding. ( , )
|
"MediaPause"
|
Pause the currently playing media. ( , )
Media controller devices should use this value rather than |
"MediaPlay"
| Initiate or continue media playback at normal speed, if not currently playing at normal speed. ( , )
|
"MediaPlayPause"
| Toggle media between play and pause states. ( , )
|
"MediaRecord"
| Initiate or resume recording of currently selected media. ( , )
|
"MediaRewind"
| Initiate or continue reverse playback at faster than normal speed, or increase speed if already rewinding. ( , )
|
"MediaStop"
| Stop media playing, pausing, forwarding, rewinding, or recording, if not already stopped. ( , )
|
"MediaTrackNext"
| Seek to next media or program track. ( , )
|
"MediaTrackPrevious"
| Seek to previous media or program track. ( , )
|
"New"
| Open a new document or message. (APPCOMMAND_NEW )
|
"Open"
| Open an existing document or message. (APPCOMMAND_OPEN )
|
"Print"
| Print the current document or message. (APPCOMMAND_PRINT )
|
"Save"
| Save the current document or message. (APPCOMMAND_SAVE )
|
"SpellCheck"
| Spellcheck the current document or selection. (APPCOMMAND_SPELL_CHECK )
|
2.11. Multimedia Numpad Keys
The normal 0
... 9
numpad keys are encoded as "0"
... "9"
, but some multimedia keypads have buttons numbered from 1
... 12
. In these instances, the 10
key is often labeled 10 /0
.
The 10
or 10 /0
key MUST be assigned a key
value of "0"
.
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"Key11"
| The 11 key found on media numpads that have buttons from 1 ... 12 .
|
"Key12"
| The 12 key found on media numpads that have buttons from 1 ... 12 .
|
2.12. Audio Keys
Multimedia keys related to audio.
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"AudioBalanceLeft"
| Adjust audio balance leftward. (VK_AUDIO_BALANCE_LEFT )
|
"AudioBalanceRight"
| Adjust audio balance rightward. (VK_AUDIO_BALANCE_RIGHT )
|
"AudioBassDown"
| Decrease bass. (APPCOMMAND_BASS_DOWN )
|
"AudioBassBoostDown"
| Decrease audio bass boost or cycle down through bass boost states. (VK_BASS_BOOST_DOWN )
|
"AudioBassBoostToggle"
| Toggle bass boost on/off. (APPCOMMAND_BASS_BOOST )
|
"AudioBassBoostUp"
| Increase audio bass boost or cycle up through bass boost states. (VK_BASS_BOOST_UP )
|
"AudioBassUp"
| Increase bass. (APPCOMMAND_BASS_UP )
|
"AudioFaderFront"
| Adjust audio fader towards front. (VK_FADER_FRONT )
|
"AudioFaderRear"
| Adjust audio fader towards rear. (VK_FADER_REAR )
|
"AudioSurroundModeNext"
| Advance surround audio mode to next available mode. (VK_SURROUND_MODE_NEXT )
|
"AudioTrebleDown"
| Decrease treble. (APPCOMMAND_TREBLE_DOWN )
|
"AudioTrebleUp"
| Increase treble. (APPCOMMAND_TREBLE_UP )
|
"AudioVolumeDown"
| Decrease audio volume. ( , )
|
"AudioVolumeUp"
| Increase audio volume. ( , )
|
"AudioVolumeMute"
| Toggle between muted state and prior volume level. ( , )
|
"MicrophoneToggle"
| Toggle the microphone on/off. (APPCOMMAND_MIC_ON_OFF_TOGGLE )
|
"MicrophoneVolumeDown"
| Decrease microphone volume. (APPCOMMAND_MICROPHONE_VOLUME_DOWN )
|
"MicrophoneVolumeUp"
| Increase microphone volume. (APPCOMMAND_MICROPHONE_VOLUME_UP )
|
"MicrophoneVolumeMute"
| Mute the microphone. ( , )
|
2.13. Speech Keys
Multimedia keys related to speech recognition.
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"SpeechCorrectionList"
| Show correction list when a word is incorrectly identified. (APPCOMMAND_CORRECTION_LIST )
|
"SpeechInputToggle"
| Toggle between dictation mode and command/control mode. (APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE )
|
2.14. Application Keys
The Application Keys are special keys that are assigned to launch a particular application. Additional application key names can be defined by concatenating "Launch" with the name of the application.
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"LaunchCalculator"
| The "Calculator" key. This is often the generic "LaunchApplication" key, as index 2. ( , )
|
"LaunchCalendar"
| The "Calendar" key. (KEYCODE_CALENDAR )
|
"LaunchContacts"
| The "Contacts" key. (KEYCODE_CONTACTS )
|
"LaunchMail"
| The "Mail" key. (APPCOMMAND_LAUNCH_MAIL )
|
"LaunchMediaPlayer"
| The "Media Player" key. (APPCOMMAND_LAUNCH_MEDIA_SELECT )
|
"LaunchMusicPlayer"
| The "Music Player" key. |
"LaunchMyComputer"
| The "My Computer" key. This is often the generic "LaunchApplication" key, as index 1. (APPCOMMAND_LAUNCH_APP1 )
|
"LaunchPhone"
| The "Phone" key. |
"LaunchScreenSaver"
| The "Screen Saver" key. |
"LaunchSpreadsheet"
| The "Spreadsheet" key. |
"LaunchWebBrowser"
| The "Web Browser" key. |
"LaunchWebCam"
| The "WebCam" key. |
"LaunchWordProcessor"
| The "Word Processor" key. |
2.15. Browser Keys
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"BrowserBack"
| Navigate to previous content or page in current history. (APPCOMMAND_BROWSER_BACKWARD )
|
"BrowserFavorites"
| Open the list of browser favorites. (APPCOMMAND_BROWSER_FAVORITES )
|
"BrowserForward"
| Navigate to next content or page in current history. (APPCOMMAND_BROWSER_FORWARD )
|
"BrowserHome"
| Go to the user’s preferred home page. (APPCOMMAND_BROWSER_HOME )
|
"BrowserRefresh"
| Refresh the current page or content. (APPCOMMAND_BROWSER_REFRESH )
|
"BrowserSearch"
| Call up the user’s preferred search page. (APPCOMMAND_BROWSER_SEARCH )
|
"BrowserStop"
| Stop loading the current page or content. (APPCOMMAND_BROWSER_STOP )
|
2.16. Mobile Phone Keys
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"AppSwitch"
| The Application switch key, which provides a list of recent apps to switch between. (KEYCODE_APP_SWITCH )
|
"Call"
| The Call key. (KEYCODE_CALL )
|
"Camera"
| The Camera key. (KEYCODE_CAMERA )
|
"CameraFocus"
| The Camera focus key. (KEYCODE_FOCUS )
|
"EndCall"
| The End Call key. (KEYCODE_ENDCALL )
|
"GoBack"
| The Back key. (KEYCODE_BACK )
|
"GoHome"
| The Home key, which goes to the phone’s main screen. (KEYCODE_HOME )
|
"HeadsetHook"
| The Headset Hook key. (KEYCODE_HEADSETHOOK )
|
"LastNumberRedial"
| The Last Number Redial key. |
"Notification"
| The Notification key. (KEYCODE_NOTIFICATION )
|
"MannerMode"
| Toggle between manner mode state: silent, vibrate, ring, ... (KEYCODE_MANNER_MODE )
|
"VoiceDial"
| The Voice Dial key. |
2.17. TV Keys
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"TV"
| Switch to viewing TV. (KEYCODE_TV )
|
"TV3DMode"
| TV 3D Mode. (KEYCODE_3D_MODE )
|
"TVAntennaCable"
| Toggle between antenna and cable input. (KEYCODE_TV_ANTENNA_CABLE )
|
"TVAudioDescription"
| Audio description. (KEYCODE_TV_AUDIO_DESCRIPTION )
|
"TVAudioDescriptionMixDown"
| Audio description mixing volume down. (KEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN )
|
"TVAudioDescriptionMixUp"
| Audio description mixing volume up. (KEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP )
|
"TVContentsMenu"
| Contents menu. (KEYCODE_TV_CONTENTS_MENU )
|
"TVDataService"
| Contents menu. (KEYCODE_TV_DATA_SERVICE )
|
"TVInput"
| Switch the input mode on an external TV. (KEYCODE_TV_INPUT )
|
"TVInputComponent1"
| Switch to component input #1. (KEYCODE_TV_INPUT_COMPONENT_1 )
|
"TVInputComponent2"
| Switch to component input #2. (KEYCODE_TV_INPUT_COMPONENT_2 )
|
"TVInputComposite1"
| Switch to composite input #1. (KEYCODE_TV_INPUT_COMPOSITE_1 )
|
"TVInputComposite2"
| Switch to composite input #2. (KEYCODE_TV_INPUT_COMPOSITE_2 )
|
"TVInputHDMI1"
| Switch to HDMI input #1. (KEYCODE_TV_INPUT_HDMI_1 )
|
"TVInputHDMI2"
| Switch to HDMI input #2. (KEYCODE_TV_INPUT_HDMI_2 )
|
"TVInputHDMI3"
| Switch to HDMI input #3. (KEYCODE_TV_INPUT_HDMI_3 )
|
"TVInputHDMI4"
| Switch to HDMI input #4. (KEYCODE_TV_INPUT_HDMI_4 )
|
"TVInputVGA1"
| Switch to VGA input #1. (KEYCODE_TV_INPUT_VGA_1 )
|
"TVMediaContext"
| Media context menu. (KEYCODE_TV_MEDIA_CONTEXT_MENU )
|
"TVNetwork"
| Toggle network. (KEYCODE_TV_NETWORK )
|
"TVNumberEntry"
| Number entry. (KEYCODE_TV_NUMBER_ENTRY )
|
"TVPower"
| Toggle the power on an external TV. (KEYCODE_TV_POWER )
|
"TVRadioService"
| Radio. (KEYCODE_TV_RADIO_SERVICE )
|
"TVSatellite"
| Satellite. (KEYCODE_TV_SATELLITE )
|
"TVSatelliteBS"
| Broadcast Satellite. (KEYCODE_TV_SATELLITE_BS )
|
"TVSatelliteCS"
| Communication Satellite. (KEYCODE_TV_SATELLITE_CS )
|
"TVSatelliteToggle"
| Toggle between available satellites. (KEYCODE_TV_SATELLITE_SERVICE )
|
"TVTerrestrialAnalog"
| Analog Terrestrial. (KEYCODE_TV_TERRESTRIAL_ANALOG )
|
"TVTerrestrialDigital"
| Digital Terrestrial. (KEYCODE_TV_TERRESTRIAL_DIGITAL )
|
"TVTimer"
| Timer programming. (KEYCODE_TV_TIMER_PROGRAMMING )
|
2.18. Media Controller Keys
The key values for media controllers (e.g. remote controls for television, audio systems, and set-top boxes) are derived in part from the consumer electronics technical specifications:
-
DTV Application Software Environment [DASE]
-
Open Cable Application Platform 1.1.3 [OCAP]
-
ANSI/CEA-2014-B, Web-based Protocol and Framework for Remote User Interface on UPnPTM Networks and the Internet [WEB4CE]
-
Android KeyEvent KEYCODEs [AndroidKeycode]
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"AVRInput"
| Switch the input mode on an external AVR (audio/video receiver). (KEYCODE_AVR_INPUT )
|
"AVRPower"
| Toggle the power on an external AVR (audio/video receiver). (KEYCODE_AVR_POWER )
|
"ColorF0Red"
| General purpose color-coded media function key, as index 0 (red). ( , )
|
"ColorF1Green"
| General purpose color-coded media function key, as index 1 (green). ( , )
|
"ColorF2Yellow"
| General purpose color-coded media function key, as index 2 (yellow). ( , )
|
"ColorF3Blue"
| General purpose color-coded media function key, as index 3 (blue). ( , )
|
"ColorF4Grey"
| General purpose color-coded media function key, as index 4 (grey). (VK_COLORED_KEY_4 )
|
"ColorF5Brown"
| General purpose color-coded media function key, as index 5 (brown). (VK_COLORED_KEY_5 )
|
"ClosedCaptionToggle"
| Toggle the display of Closed Captions. ( , )
|
"Dimmer"
| Adjust brightness of device, by toggling between or cycling through states. (VK_DIMMER )
|
"DisplaySwap"
| Swap video sources. (VK_DISPLAY_SWAP )
|
"DVR"
| Select Digital Video Rrecorder. (KEYCODE_DVR )
|
"Exit"
| Exit the current application. (VK_EXIT )
|
"FavoriteClear0"
| Clear program or content stored as favorite 0. (VK_CLEAR_FAVORITE_0 )
|
"FavoriteClear1"
| Clear program or content stored as favorite 1. (VK_CLEAR_FAVORITE_1 )
|
"FavoriteClear2"
| Clear program or content stored as favorite 2. (VK_CLEAR_FAVORITE_2 )
|
"FavoriteClear3"
| Clear program or content stored as favorite 3. (VK_CLEAR_FAVORITE_3 )
|
"FavoriteRecall0"
| Select (recall) program or content stored as favorite 0. (VK_RECALL_FAVORITE_0 )
|
"FavoriteRecall1"
| Select (recall) program or content stored as favorite 1. (VK_RECALL_FAVORITE_1 )
|
"FavoriteRecall2"
| Select (recall) program or content stored as favorite 2. (VK_RECALL_FAVORITE_2 )
|
"FavoriteRecall3"
| Select (recall) program or content stored as favorite 3. (VK_RECALL_FAVORITE_3 )
|
"FavoriteStore0"
| Store current program or content as favorite 0. (VK_STORE_FAVORITE_0 )
|
"FavoriteStore1"
| Store current program or content as favorite 1. (VK_STORE_FAVORITE_1 )
|
"FavoriteStore2"
| Store current program or content as favorite 2. (VK_STORE_FAVORITE_2 )
|
"FavoriteStore3"
| Store current program or content as favorite 3. (VK_STORE_FAVORITE_3 )
|
"Guide"
| Toggle display of program or content guide. ( , )
|
"GuideNextDay"
| If guide is active and displayed, then display next day’s content. (VK_NEXT_DAY )
|
"GuidePreviousDay"
| If guide is active and displayed, then display previous day’s content. (VK_PREV_DAY )
|
"Info"
| Toggle display of information about currently selected context or media. ( , )
|
"InstantReplay"
| Toggle instant replay. (VK_INSTANT_REPLAY )
|
"Link"
| Launch linked content, if available and appropriate. (VK_LINK )
|
"ListProgram"
| List the current program. (VK_LIST )
|
"LiveContent"
| Toggle display listing of currently available live content or programs. (VK_LIVE )
|
"Lock"
| Lock or unlock current content or program. (VK_LOCK )
|
"MediaApps"
|
Show a list of media applications: audio/video players and image viewers. (VK_APPS )
Do not confuse this key value with the Windows' |
"MediaAudioTrack"
| Audio track key. (KEYCODE_MEDIA_AUDIO_TRACK )
|
"MediaLast"
| Select previously selected channel or media. ( , )
|
"MediaSkipBackward"
| Skip backward to next content or program. (KEYCODE_MEDIA_SKIP_BACKWARD )
|
"MediaSkipForward"
| Skip forward to next content or program. ( , )
|
"MediaStepBackward"
| Step backward to next content or program. (KEYCODE_MEDIA_STEP_BACKWARD )
|
"MediaStepForward"
| Step forward to next content or program. (KEYCODE_MEDIA_STEP_FORWARD )
|
"MediaTopMenu"
| Media top menu. (KEYCODE_MEDIA_TOP_MENU )
|
"NavigateIn"
| Navigate in. (KEYCODE_NAVIGATE_IN )
|
"NavigateNext"
| Navigate to next key. (KEYCODE_NAVIGATE_NEXT )
|
"NavigateOut"
| Navigate out. (KEYCODE_NAVIGATE_OUT )
|
"NavigatePrevious"
| Navigate to previous key. (KEYCODE_NAVIGATE_PREVIOUS )
|
"NextFavoriteChannel"
| Cycle to next favorite channel (in favorites list). (VK_NEXT_FAVORITE_CHANNEL )
|
"NextUserProfile"
| Cycle to next user profile (if there are multiple user profiles). (VK_USER )
|
"OnDemand"
| Access on-demand content or programs. (VK_ON_DEMAND )
|
"Pairing"
| Pairing key to pair devices. (KEYCODE_PAIRING )
|
"PinPDown"
| Move picture-in-picture window down. (VK_PINP_DOWN )
|
"PinPMove"
| Move picture-in-picture window. (VK_PINP_MOVE )
|
"PinPToggle"
| Toggle display of picture-in-picture window. (VK_PINP_TOGGLE )
|
"PinPUp"
| Move picture-in-picture window up. (VK_PINP_UP )
|
"PlaySpeedDown"
| Decrease media playback speed. (VK_PLAY_SPEED_DOWN )
|
"PlaySpeedReset"
| Reset playback to normal speed. (VK_PLAY_SPEED_RESET )
|
"PlaySpeedUp"
| Increase media playback speed. (VK_PLAY_SPEED_UP )
|
"RandomToggle"
| Toggle random media or content shuffle mode. (VK_RANDOM_TOGGLE )
|
"RcLowBattery"
| Not a physical key, but this key code is sent when the remote control battery is low. (VK_RC_LOW_BATTERY )
|
"RecordSpeedNext"
| Toggle or cycle between media recording speeds. (VK_RECORD_SPEED_NEXT )
|
"RfBypass"
| Toggle RF (radio frequency) input bypass mode (pass RF input directly to the RF output). (VK_RF_BYPASS )
|
"ScanChannelsToggle"
| Toggle scan channels mode. (VK_SCAN_CHANNELS_TOGGLE )
|
"ScreenModeNext"
| Advance display screen mode to next available mode. (VK_SCREEN_MODE_NEXT )
|
"Settings"
| Toggle display of device settings screen. ( , )
|
"SplitScreenToggle"
| Toggle split screen mode. (VK_SPLIT_SCREEN_TOGGLE )
|
"STBInput"
| Switch the input mode on an external STB (set top box). (KEYCODE_STB_INPUT )
|
"STBPower"
| Toggle the power on an external STB (set top box). (KEYCODE_STB_POWER )
|
"Subtitle"
| Toggle display of subtitles, if available. (VK_SUBTITLE )
|
"Teletext"
| Toggle display of teletext, if available ( , ).
|
"VideoModeNext"
| Advance video mode to next available mode. (VK_VIDEO_MODE_NEXT )
|
"Wink"
| Cause device to identify itself in some manner, e.g., audibly or visibly. (VK_WINK )
|
"ZoomToggle"
| Toggle between full-screen and scaled content, or alter magnification level. ( , )
|
Some of the keys defined in the media controller standards already have appropriate keys defined in other sections of this specification. These following table summarizes the key values that MUST be used:
KeyboardEvent .key
| Typical Usage (Non-normative) |
---|---|
"AudioVolumeDown"
| Decrease audio volume. (VK_VOLUME_DOWN )
|
"AudioVolumeUp"
| Increase audio volume. (VK_VOLUME_UP )
|
"AudioVolumeMute"
| Toggle between muted state and prior volume level. (VK_VOLUME_MUTE )
|
"BrowserBack"
| Navigate to previous content or page in current history. (VK_BACK )
|
"BrowserForward"
| Navigate to next content or page in current history. (VK_FORWARD )
|
"ChannelDown"
| Select next (numerically or logically) lower channel. (VK_CHANNEL_DOWN )
|
"ChannelUp"
| Select next (numerically or logically) higher channel. (VK_CHANNEL_UP )
|
"ContextMenu"
| Toggle display of the on-screen menu. (VK_MENU )
|
"Eject"
| Toggle removable media to eject (open) and insert (close) state. (VK_EJECT_TOGGLE )
|
"End"
| The End key, used with keyboard entry to go to the end of content. (VK_GO_TO_END )
|
"Enter"
| The Enter key, to activate current selection or accept current input. (VK_SELECT )
|
"Home"
| The Home key, used with keyboard entry, to go to start of content. (VK_GO_TO_START )
|
"MediaFastForward"
| Initiate or continue forward playback at faster than normal speed, or increase speed if already fast forwarding. (VK_FAST_FWD )
|
"MediaPlay"
| Initiate or continue media playback at normal speed, if not currently playing at normal speed. (VK_PLAY )
|
"MediaPlayPause"
| Toggle media between play and pause states. (VK_PLAY_PAUSE )
|
"MediaRecord"
| Initiate or resume recording of currently selected media. (VK_RECORD )
|
"MediaRewind"
| Initiate or continue reverse playback at faster than normal speed, or increase speed if already rewinding. (VK_REWIND )
|
"MediaStop"
| Stop media playing, pausing, forwarding, rewinding, or recording, if not already stopped. (VK_STOP )
|
"MediaNextTrack"
| Seek to next media or program track. (VK_TRACK_NEXT )
|
"MediaPause"
| Pause the currently playing media. (VK_PAUSE )
|
"MediaPreviousTrack"
| Seek to previous media or program track. (VK_TRACK_PREV )
|
"Power"
| Toggle power state. (VK_POWER )
|
"Unidentified"
| This key value is used when an implementations is unable to identify another key value, due to either hardware, platform, or software constraints. (VK_UNDEFINED )
|
3. Acknowledgements
Over the years, many people contributed to the DOM KeyboardEvent
specifications, including many participants of the DOM Working Group and the
WebApps Working Group. The current set of key
values is
the result of iterating over many proposals and variations during that time.
We especially thank the following participants for their contributions:
Gary Kacmarcik (Google), Masayuki Nakano (Mozilla) and Travis Leithead (Microsoft).