JavaScript Keycode Finder
Press a key: get its key, code and keyCode, plus listener code ready to paste.
Keys pressed while this box has focus are shown below. With “Block browser shortcuts” on, Ctrl, ⌘, Alt and function-key combinations do nothing else here, except the few no page can block (such as Ctrl + W). Tab still moves on.
- Ctrl : off
- Shift : off
- Alt / Option : off
- Meta (⌘ / Win) : off
- Caps Lock : off
- Num Lock : off
- AltGr : off
A key value, a code value, a single character or a common name such as Esc or Cmd.
All properties
| Event | |
|---|---|
| event.key | |
| event.code | |
| event.keyCode | |
| event.which | |
| event.charCode | |
| event.location | |
| event.ctrlKey | |
| event.shiftKey | |
| event.altKey | |
| event.metaKey | |
| event.repeat | |
| event.isComposing | |
| getModifierState( | |
| getModifierState( | |
| getModifierState( | |
| getModifierState( | |
| Combination | |
| aria-keyshortcuts | |
| Your layout types | |
Notes
Listener code
aria-keyshortcuts
Event log
| ms | Event | key | code | keyCode | location | Modifiers | Details |
|---|
Newest first; up to 200 events are kept. The time is milliseconds since the first logged event. Copy log gives tab-separated text for a spreadsheet or a bug report.
Key, code and keyCode reference
| key value | Typical use |
|---|---|
| Special | |
Unidentified | This key value is used when an implementation is unable to identify another key value, due to either hardware, platform, or software constraints. VK_UNDEFINED |
| Modifier keys | |
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. |
Alt | 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). |
Caps | 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. |
Fnoptional | 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. |
Fnoptional | 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. |
Meta | The Meta key, to enable meta modifier function for interpreting concurrent or subsequent keyboard input. This key value is used for the Windows Logo key and the Apple Command or ⌘ key. |
Num | The NumLock or Number Lock key, to toggle numpad mode function for interpreting subsequent keyboard input. |
Scroll | 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. |
Symboloptional | The Symbol modifier key (used on some virtual keyboards). |
Symboloptional | The Symbol Lock key. |
Hyperoptional | The Hyper key. |
Superoptional | The Super key. |
| Whitespace keys | |
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. VK_SELECT |
Tab | The Horizontal Tabulation Tab key. |
| Navigation keys | |
Arrow | The down arrow key, to navigate or traverse downward. KEYCODE_DPAD_DOWN |
Arrow | The left arrow key, to navigate or traverse leftward. KEYCODE_DPAD_LEFT |
Arrow | The right arrow key, to navigate or traverse rightward. KEYCODE_DPAD_RIGHT |
Arrow | 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, VK_GO_TO_END |
Home | The Home key, used with keyboard entry, to go to start of content. For the mobile phone Home key (which goes to the phone’s main screen), use "GoHome". KEYCODE_MOVE_HOME, VK_GO_TO_START |
Page | The Page Down key, to scroll down or display next page of content. |
Page | The Page Up key, to scroll up or display previous page of content. |
| Editing keys | |
Backspace | The Backspace key. This key value is also used for the key labeled Delete on MacOS keyboards. |
Clearoptional | Remove the currently selected input. |
Copyoptional | Copy the current selection. APPCOMMAND_COPY |
Croptional | The Cursor Select (Crsel) key. |
Cutoptional | 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. |
Eraseoptional | The Erase to End of Field key. This key deletes all characters from the current cursor position to the end of the current field. |
Exoptional | The Extend Selection (Exsel) key. |
Insert | The Insert (Ins) key, to toggle between text modes for insertion or overtyping. KEYCODE_INSERT |
Pasteoptional | The Paste key. APPCOMMAND_PASTE |
Redooptional | Redo the last action. APPCOMMAND_REDO |
Undooptional | Undo the last action. APPCOMMAND_UNDO |
| UI keys | |
Acceptoptional | The Accept (Commit, OK) key. Accept current option or input method sequence conversion. |
Againoptional | The Again key, to redo or repeat an action. |
Attnoptional | The Attention (Attn) key. |
Canceloptional | The Cancel key. |
Context | Show the application’s context menu. This key is commonly found between the right Meta key and the right Control key. VK_MENU |
Escape | The 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. |
Executeoptional | The Execute key. |
Findoptional | Open the Find dialog. APPCOMMAND_FIND |
Help | Open a help dialog or toggle display of help information. APPCOMMAND_HELP, KEYCODE_HELP |
Pause | Pause the current state or application (as appropriate). Do not use this value for the Pause button on media controllers. Use "MediaPause" instead. |
Playoptional | Play or resume the current state or application (as appropriate). Do not use this value for the Play button on media controllers. Use "MediaPlay" instead. |
Propsoptional | The properties (Props) key. |
Selectoptional | The Select key. |
Zoomoptional | The ZoomIn key. KEYCODE_ZOOM_IN |
Zoomoptional | The ZoomOut key. KEYCODE_ZOOM_OUT |
| Device keys | |
Brightnessoptional | The Brightness Down key. Typically controls the display brightness. KEYCODE_BRIGHTNESS_DOWN |
Brightnessoptional | The Brightness Up key. Typically controls the display brightness. KEYCODE_BRIGHTNESS_UP |
Ejectoptional | Toggle removable media to eject (open) and insert (close) state. KEYCODE_MEDIA_EJECT, VK_EJECT_TOGGLE |
Logoptional | The LogOff key. |
Poweroptional | Toggle power state. Note: Some devices might not expose this key to the operating environment. KEYCODE_POWER, VK_POWER |
Poweroptional | The PowerOff key. Sometime called PowerDown. |
Print | The Print Screen or SnapShot key, to initiate print-screen function. |
Hibernateoptional | 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. |
Standbyoptional | 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. KEYCODE_SLEEP |
Wakeoptional | The WakeUp key. KEYCODE_WAKEUP |
| IME and composition keys | |
Alloptional | The All Candidates key, to initiate the multi-candidate mode. |
Alphanumericoptional | The Alphanumeric key. |
Codeoptional | The Code Input key, to initiate the Code Input mode to allow characters to be entered by their code points. |
Composeoptional | 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. |
Convertoptional | The Convert key, to convert the current input method sequence. |
Deadoptional | 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 activated, this is the key value U+0302 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. |
Finaloptional | The Final Mode Final key used on some Asian keyboards, to enable the final mode for IMEs. |
Groupoptional | Switch to the first character group. (ISO/IEC 9995) |
Groupoptional | Switch to the last character group. (ISO/IEC 9995) |
Groupoptional | Switch to the next character group. (ISO/IEC 9995) |
Groupoptional | Switch to the previous character group. (ISO/IEC 9995) |
Modeoptional | The Mode Change key, to toggle between or cycle through input modes of IMEs. |
Nextoptional | The Next Candidate function key. |
Nonoptional | The NonConvert ("Don’t Convert") key, to accept current input method sequence without conversion in IMEs. |
Previousoptional | The Previous Candidate function key. |
Processoptional | The Process key. |
Singleoptional | The Single Candidate function key. |
Hanguloptional | The Hangul (Korean characters) Mode key, to toggle between Hangul and English modes. |
Hanjaoptional | The Hanja (Korean characters) Mode key. |
Junjaoptional | The Junja (Korean characters) Mode key. |
Eisuoptional | The Eisu key. This key may close the IME, but its purpose is defined by the current IME. KEYCODE_EISU |
Hankakuoptional | The (Half-Width) Characters key. |
Hiraganaoptional | The Hiragana (Japanese Kana characters) key. |
Hiraganaoptional | The Hiragana/Katakana toggle key. KEYCODE_KATAKANA_HIRAGANA |
Kanaoptional | The Kana Mode (Kana Lock) key. This key is used to enter hiragana mode (typically from romaji mode). |
Kanjioptional | The Kanji (Japanese name for ideographic characters of Chinese origin) Mode key. This key is typically used to switch to a hiragana keyboard for the purpose of converting input into kanji. KEYCODE_KANA |
Katakanaoptional | The Katakana (Japanese Kana characters) key. |
Romajioptional | The Roman characters function key. |
Zenkakuoptional | The Zenkaku (Full-Width) Characters key. |
Zenkakuoptional | The Zenkaku/Hankaku (full-width/half-width) toggle key. KEYCODE_ZENKAKU_HANKAKU |
| Function keys | |
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. |
Soft1optional | General purpose virtual function key, as index 1. |
Soft2optional | General purpose virtual function key, as index 2. |
Soft3optional | General purpose virtual function key, as index 3. |
Soft4optional | General purpose virtual function key, as index 4. |
| Multimedia keys | |
Channeloptional | Select next (numerically or logically) lower channel. APPCOMMAND_MEDIA_CHANNEL_DOWN, KEYCODE_CHANNEL_DOWN, VK_CHANNEL_DOWN |
Channeloptional | Select next (numerically or logically) higher channel. APPCOMMAND_MEDIA_CHANNEL_UP, KEYCODE_CHANNEL_UP, VK_CHANNEL_UP |
Closeoptional | Close the current document or message (Note: This doesn’t close the application). APPCOMMAND_CLOSE |
Mailoptional | Open an editor to forward the current message. APPCOMMAND_FORWARD_MAIL |
Mailoptional | Open an editor to reply to the current message. APPCOMMAND_REPLY_TO_MAIL |
Mailoptional | Send the current message. APPCOMMAND_SEND_MAIL |
Mediaoptional | Close the current media, for example to close a CD or DVD tray. KEYCODE_MEDIA_CLOSE |
Mediaoptional | Initiate or continue forward playback at faster than normal speed, or increase speed if already fast forwarding. APPCOMMAND_MEDIA_FAST_FORWARD, KEYCODE_MEDIA_FAST_FORWARD, VK_FAST_FWD |
Mediaoptional | Pause the currently playing media. Media controller devices should use this value rather than "Pause" for their pause keys. APPCOMMAND_MEDIA_PAUSE, KEYCODE_MEDIA_PAUSE, VK_PAUSE |
Mediaoptional | Initiate or continue media playback at normal speed, if not currently playing at normal speed. APPCOMMAND_MEDIA_PLAY, KEYCODE_MEDIA_PLAY, VK_PLAY |
Mediaoptional | Toggle media between play and pause states. APPCOMMAND_MEDIA_PLAY_PAUSE, KEYCODE_MEDIA_PLAY_PAUSE, VK_PLAY_PAUSE |
Mediaoptional | Initiate or resume recording of currently selected media. APPCOMMAND_MEDIA_RECORD, KEYCODE_MEDIA_RECORD, VK_RECORD |
Mediaoptional | Initiate or continue reverse playback at faster than normal speed, or increase speed if already rewinding. APPCOMMAND_MEDIA_REWIND, KEYCODE_MEDIA_REWIND, VK_REWIND |
Mediaoptional | Stop media playing, pausing, forwarding, rewinding, or recording, if not already stopped. APPCOMMAND_MEDIA_STOP, KEYCODE_MEDIA_STOP, VK_STOP |
Mediaoptional | Seek to next media or program track. APPCOMMAND_MEDIA_NEXTTRACK, KEYCODE_MEDIA_NEXT, VK_TRACK_NEXT |
Mediaoptional | Seek to previous media or program track. APPCOMMAND_MEDIA_PREVIOUSTRACK, KEYCODE_MEDIA_PREVIOUS, VK_TRACK_PREV |
Newoptional | Open a new document or message. APPCOMMAND_NEW |
Openoptional | Open an existing document or message. APPCOMMAND_OPEN |
Printoptional | Print the current document or message. APPCOMMAND_PRINT |
Saveoptional | Save the current document or message. APPCOMMAND_SAVE |
Spelloptional | Spellcheck the current document or selection. APPCOMMAND_SPELL_CHECK |
| Multimedia numpad keys | |
Key11optional | The 11 key found on media numpads that have buttons from 1.. 12. |
Key12optional | The 12 key found on media numpads that have buttons from 1.. 12. |
| Audio keys | |
Audiooptional | Adjust audio balance leftward. VK_AUDIO_BALANCE_LEFT |
Audiooptional | Adjust audio balance rightward. VK_AUDIO_BALANCE_RIGHT |
Audiooptional | Decrease audio bass boost or cycle down through bass boost states. APPCOMMAND_BASS_DOWN, VK_BASS_BOOST_DOWN |
Audiooptional | Toggle bass boost on/off. APPCOMMAND_BASS_BOOST |
Audiooptional | Increase audio bass boost or cycle up through bass boost states. APPCOMMAND_BASS_UP, VK_BASS_BOOST_UP |
Audiooptional | Adjust audio fader towards front. VK_FADER_FRONT |
Audiooptional | Adjust audio fader towards rear. VK_FADER_REAR |
Audiooptional | Advance surround audio mode to next available mode. VK_SURROUND_MODE_NEXT |
Audiooptional | Decrease treble. APPCOMMAND_TREBLE_DOWN |
Audiooptional | Increase treble. APPCOMMAND_TREBLE_UP |
Audiooptional | Decrease audio volume. APPCOMMAND_VOLUME_DOWN, KEYCODE_VOLUME_DOWN, VK_VOLUME_DOWN |
Audiooptional | Increase audio volume. APPCOMMAND_VOLUME_UP, KEYCODE_VOLUME_UP, VK_VOLUME_UP |
Audiooptional | Toggle between muted state and prior volume level. APPCOMMAND_VOLUME_MUTE, KEYCODE_VOLUME_MUTE, VK_VOLUME_MUTE |
Microphoneoptional | Toggle the microphone on/off. APPCOMMAND_MIC_ON_OFF_TOGGLE |
Microphoneoptional | Decrease microphone volume. APPCOMMAND_MICROPHONE_VOLUME_DOWN |
Microphoneoptional | Increase microphone volume. APPCOMMAND_MICROPHONE_VOLUME_UP |
Microphoneoptional | Mute the microphone. APPCOMMAND_MICROPHONE_VOLUME_MUTE, KEYCODE_MUTE |
| Speech keys | |
Speechoptional | Show correction list when a word is incorrectly identified. APPCOMMAND_CORRECTION_LIST |
Speechoptional | Toggle between dictation mode and command/control mode. APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE |
| Application keys | |
Launchoptional | The first generic "LaunchApplication" key. This is commonly associated with launching "My Computer", and may have a computer symbol on the key. APPCOMMAND_LAUNCH_APP1 |
Launchoptional | The second generic "LaunchApplication" key. This is commonly associated with launching "Calculator", and may have a calculator symbol on the key. APPCOMMAND_LAUNCH_APP2, KEYCODE_CALCULATOR |
Launchoptional | The "Calendar" key. KEYCODE_CALENDAR |
Launchoptional | The "Contacts" key. KEYCODE_CONTACTS |
Launchoptional | The "Mail" key. APPCOMMAND_LAUNCH_MAIL |
Launchoptional | The "Media Player" key. APPCOMMAND_LAUNCH_MEDIA_SELECT |
Launchoptional | The "Music Player" key. |
Launchoptional | The "Phone" key. |
Launchoptional | The "Screen Saver" key. |
Launchoptional | The "Spreadsheet" key. |
Launchoptional | The "Web Browser" key. |
Launchoptional | The "WebCam" key. |
Launchoptional | The "Word Processor" key. |
| Browser keys | |
Browseroptional | Navigate to previous content or page in current history. APPCOMMAND_BROWSER_BACKWARD, VK_BACK |
Browseroptional | Open the list of browser favorites. APPCOMMAND_BROWSER_FAVORITES |
Browseroptional | Navigate to next content or page in current history. APPCOMMAND_BROWSER_FORWARD, VK_FORWARD |
Browseroptional | Go to the user’s preferred home page. APPCOMMAND_BROWSER_HOME |
Browseroptional | Refresh the current page or content. APPCOMMAND_BROWSER_REFRESH |
Browseroptional | Call up the user’s preferred search page. APPCOMMAND_BROWSER_SEARCH |
Browseroptional | Stop loading the current page or content. APPCOMMAND_BROWSER_STOP |
| Mobile phone keys | |
Appoptional | The Application switch key, which provides a list of recent apps to switch between. KEYCODE_APP_SWITCH |
Calloptional | The Call key. KEYCODE_CALL |
Cameraoptional | The Camera key. KEYCODE_CAMERA |
Cameraoptional | The Camera focus key. KEYCODE_FOCUS |
Endoptional | The End Call key. KEYCODE_ENDCALL |
Gooptional | The Back key. KEYCODE_BACK |
Gooptional | The Home key, which goes to the phone’s main screen. KEYCODE_HOME |
Headsetoptional | The Headset Hook key. KEYCODE_HEADSETHOOK |
Lastoptional | The Last Number Redial key. |
Notificationoptional | The Notification key. KEYCODE_NOTIFICATION |
Manneroptional | Toggle between manner mode state: silent, vibrate, ring,.. KEYCODE_MANNER_MODE |
Voiceoptional | The Voice Dial key. |
| TV keys | |
TVoptional | Switch to viewing TV. KEYCODE_TV |
TV3optional | TV 3D Mode. KEYCODE_3D_MODE |
TVAntennaoptional | Toggle between antenna and cable input. KEYCODE_TV_ANTENNA_CABLE |
TVAudiooptional | Audio description. KEYCODE_TV_AUDIO_DESCRIPTION |
TVAudiooptional | Audio description mixing volume down. KEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN |
TVAudiooptional | Audio description mixing volume up. KEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP |
TVContentsoptional | Contents menu. KEYCODE_TV_CONTENTS_MENU |
TVDataoptional | Contents menu. KEYCODE_TV_DATA_SERVICE |
TVInputoptional | Switch the input mode on an external TV. KEYCODE_TV_INPUT |
TVInputoptional | Switch to component input #1. KEYCODE_TV_INPUT_COMPONENT_1 |
TVInputoptional | Switch to component input #2. KEYCODE_TV_INPUT_COMPONENT_2 |
TVInputoptional | Switch to composite input #1. KEYCODE_TV_INPUT_COMPOSITE_1 |
TVInputoptional | Switch to composite input #2. KEYCODE_TV_INPUT_COMPOSITE_2 |
TVInputoptional | Switch to HDMI input #1. KEYCODE_TV_INPUT_HDMI_1 |
TVInputoptional | Switch to HDMI input #2. KEYCODE_TV_INPUT_HDMI_2 |
TVInputoptional | Switch to HDMI input #3. KEYCODE_TV_INPUT_HDMI_3 |
TVInputoptional | Switch to HDMI input #4. KEYCODE_TV_INPUT_HDMI_4 |
TVInputoptional | Switch to VGA input #1. KEYCODE_TV_INPUT_VGA_1 |
TVMediaoptional | Media context menu. KEYCODE_TV_MEDIA_CONTEXT_MENU |
TVNetworkoptional | Toggle network. KEYCODE_TV_NETWORK |
TVNumberoptional | Number entry. KEYCODE_TV_NUMBER_ENTRY |
TVPoweroptional | Toggle the power on an external TV. KEYCODE_TV_POWER |
TVRadiooptional | Radio. KEYCODE_TV_RADIO_SERVICE |
TVSatelliteoptional | Satellite. KEYCODE_TV_SATELLITE |
TVSatelliteoptional | Broadcast Satellite. KEYCODE_TV_SATELLITE_BS |
TVSatelliteoptional | Communication Satellite. KEYCODE_TV_SATELLITE_CS |
TVSatelliteoptional | Toggle between available satellites. KEYCODE_TV_SATELLITE_SERVICE |
TVTerrestrialoptional | Analog Terrestrial. KEYCODE_TV_TERRESTRIAL_ANALOG |
TVTerrestrialoptional | Digital Terrestrial. KEYCODE_TV_TERRESTRIAL_DIGITAL |
TVTimeroptional | Timer programming. KEYCODE_TV_TIMER_PROGRAMMING |
| Media controller keys | |
AVRInputoptional | Switch the input mode on an external AVR (audio/video receiver). KEYCODE_AVR_INPUT |
AVRPoweroptional | Toggle the power on an external AVR (audio/video receiver). KEYCODE_AVR_POWER |
Coloroptional | General purpose color-coded media function key, as index 0 (red). VK_COLORED_KEY_0, KEYCODE_PROG_RED |
Coloroptional | General purpose color-coded media function key, as index 1 (green). VK_COLORED_KEY_1, KEYCODE_PROG_GREEN |
Coloroptional | General purpose color-coded media function key, as index 2 (yellow). VK_COLORED_KEY_2, KEYCODE_PROG_YELLOW |
Coloroptional | General purpose color-coded media function key, as index 3 (blue). VK_COLORED_KEY_3, KEYCODE_PROG_BLUE |
Coloroptional | General purpose color-coded media function key, as index 4 (grey). VK_COLORED_KEY_4 |
Coloroptional | General purpose color-coded media function key, as index 5 (brown). VK_COLORED_KEY_5 |
Closedoptional | Toggle the display of Closed Captions. VK_CC, KEYCODE_CAPTIONS |
Dimmeroptional | Adjust brightness of device, by toggling between or cycling through states. VK_DIMMER |
Displayoptional | Swap video sources. VK_DISPLAY_SWAP |
DVRoptional | Select Digital Video Rrecorder. KEYCODE_DVR |
Exitoptional | Exit the current application. VK_EXIT |
Favoriteoptional | Clear program or content stored as favorite 0. VK_CLEAR_FAVORITE_0 |
Favoriteoptional | Clear program or content stored as favorite 1. VK_CLEAR_FAVORITE_1 |
Favoriteoptional | Clear program or content stored as favorite 2. VK_CLEAR_FAVORITE_2 |
Favoriteoptional | Clear program or content stored as favorite 3. VK_CLEAR_FAVORITE_3 |
Favoriteoptional | Select (recall) program or content stored as favorite 0. VK_RECALL_FAVORITE_0 |
Favoriteoptional | Select (recall) program or content stored as favorite 1. VK_RECALL_FAVORITE_1 |
Favoriteoptional | Select (recall) program or content stored as favorite 2. VK_RECALL_FAVORITE_2 |
Favoriteoptional | Select (recall) program or content stored as favorite 3. VK_RECALL_FAVORITE_3 |
Favoriteoptional | Store current program or content as favorite 0. VK_STORE_FAVORITE_0 |
Favoriteoptional | Store current program or content as favorite 1. VK_STORE_FAVORITE_1 |
Favoriteoptional | Store current program or content as favorite 2. VK_STORE_FAVORITE_2 |
Favoriteoptional | Store current program or content as favorite 3. VK_STORE_FAVORITE_3 |
Guideoptional | Toggle display of program or content guide. VK_GUIDE, KEYCODE_GUIDE |
Guideoptional | If guide is active and displayed, then display next day’s content. VK_NEXT_DAY |
Guideoptional | If guide is active and displayed, then display previous day’s content. VK_PREV_DAY |
Infooptional | Toggle display of information about currently selected context or media. VK_INFO, KEYCODE_INFO |
Instantoptional | Toggle instant replay. VK_INSTANT_REPLAY |
Linkoptional | Launch linked content, if available and appropriate. VK_LINK |
Listoptional | List the current program. VK_LIST |
Liveoptional | Toggle display listing of currently available live content or programs. VK_LIVE |
Lockoptional | Lock or unlock current content or program. VK_LOCK |
Mediaoptional | Show a list of media applications: audio/video players and image viewers. Do not confuse this key value with the Windows' VK_APPS / VK_CONTEXT_MENU key, which is encoded as "ContextMenu". VK_APPS |
Mediaoptional | Audio track key. KEYCODE_MEDIA_AUDIO_TRACK |
Mediaoptional | Select previously selected channel or media. VK_LAST, KEYCODE_LAST_CHANNEL |
Mediaoptional | Skip backward to next content or program. KEYCODE_MEDIA_SKIP_BACKWARD |
Mediaoptional | Skip forward to next content or program. VK_SKIP, KEYCODE_MEDIA_SKIP_FORWARD |
Mediaoptional | Step backward to next content or program. KEYCODE_MEDIA_STEP_BACKWARD |
Mediaoptional | Step forward to next content or program. KEYCODE_MEDIA_STEP_FORWARD |
Mediaoptional | Media top menu. KEYCODE_MEDIA_TOP_MENU |
Navigateoptional | Navigate in. KEYCODE_NAVIGATE_IN |
Navigateoptional | Navigate to next key. KEYCODE_NAVIGATE_NEXT |
Navigateoptional | Navigate out. KEYCODE_NAVIGATE_OUT |
Navigateoptional | Navigate to previous key. KEYCODE_NAVIGATE_PREVIOUS |
Nextoptional | Cycle to next favorite channel (in favorites list). VK_NEXT_FAVORITE_CHANNEL |
Nextoptional | Cycle to next user profile (if there are multiple user profiles). VK_USER |
Onoptional | Access on-demand content or programs. VK_ON_DEMAND |
Pairingoptional | Pairing key to pair devices. KEYCODE_PAIRING |
Pinoptional | Move picture-in-picture window down. VK_PINP_DOWN |
Pinoptional | Move picture-in-picture window. VK_PINP_MOVE |
Pinoptional | Toggle display of picture-in-picture window. VK_PINP_TOGGLE |
Pinoptional | Move picture-in-picture window up. VK_PINP_UP |
Playoptional | Decrease media playback speed. VK_PLAY_SPEED_DOWN |
Playoptional | Reset playback to normal speed. VK_PLAY_SPEED_RESET |
Playoptional | Increase media playback speed. VK_PLAY_SPEED_UP |
Randomoptional | Toggle random media or content shuffle mode. VK_RANDOM_TOGGLE |
Rcoptional | Not a physical key, but this key code is sent when the remote control battery is low. VK_RC_LOW_BATTERY |
Recordoptional | Toggle or cycle between media recording speeds. VK_RECORD_SPEED_NEXT |
Rfoptional | Toggle RF (radio frequency) input bypass mode (pass RF input directly to the RF output). VK_RF_BYPASS |
Scanoptional | Toggle scan channels mode. VK_SCAN_CHANNELS_TOGGLE |
Screenoptional | Advance display screen mode to next available mode. VK_SCREEN_MODE_NEXT |
Settingsoptional | Toggle display of device settings screen. VK_SETTINGS, KEYCODE_SETTINGS |
Splitoptional | Toggle split screen mode. VK_SPLIT_SCREEN_TOGGLE |
STBInputoptional | Switch the input mode on an external STB (set top box). KEYCODE_STB_INPUT |
STBPoweroptional | Toggle the power on an external STB (set top box). KEYCODE_STB_POWER |
Subtitleoptional | Toggle display of subtitles, if available. VK_SUBTITLE |
Teletextoptional | Toggle display of teletext, if available. VK_TELETEXT, KEYCODE_TV_TELETEXT |
Videooptional | Advance video mode to next available mode. VK_VIDEO_MODE_NEXT |
Winkoptional | Cause device to identify itself in some manner, e.g., audibly or visibly. VK_WINK |
Zoomoptional | Toggle between full-screen and scaled content, or alter magnification level. VK_ZOOM, KEYCODE_TV_ZOOM_MODE |
| code value | US key | keyCode* | Your layout | Notes |
|---|---|---|---|---|
| Writing system keys | ||||
Backquote | ` ~ | 192 | `~ on a US keyboard. This is the 半角/全角/漢字 (hankaku/zenkaku/kanji) key on Japanese keyboards | |
Backslash | \ | | 220 | Used for both the US \| (on the 101-key layout) and also for the key located between the " and Enter keys on row C of the 102-, 104- and 106-key layouts. Labelled #~ on a UK (102) keyboard. | |
Bracket | [ { | 219 | [{ on a US keyboard. | |
Bracket | ] } | 221 | ]} on a US keyboard. | |
Comma | , < | 188 | ,< on a US keyboard. | |
Digit0 | 0 ) | 48 | 0) on a US keyboard. | |
Digit1 | 1 ! | 49 | 1! on a US keyboard. | |
Digit2 | 2 @ | 50 | 2@ on a US keyboard. | |
Digit3 | 3 # | 51 | 3# on a US keyboard. | |
Digit4 | 4 $ | 52 | 4$ on a US keyboard. | |
Digit5 | 5 % | 53 | 5% on a US keyboard. | |
Digit6 | 6 ^ | 54 | 6^ on a US keyboard. | |
Digit7 | 7 & | 55 | 7& on a US keyboard. | |
Digit8 | 8 * | 56 | 8* on a US keyboard. | |
Digit9 | 9 ( | 57 | 9( on a US keyboard. | |
Equal | = + | 187 | =+ on a US keyboard. | |
Intl | \ | | 226 | Located between the left Shift and Z keys. Labelled \| on a UK keyboard. | |
Intl | — | Located between the / and right Shift keys. Labelled \ろ (ro) on a Japanese keyboard. | ||
Intl | — | Located between the = and Backspace keys. Labelled ¥ (yen) on a Japanese keyboard. \/ on a Russian keyboard. | ||
Key | a A | 65 | a on a US keyboard. Labelled q on an AZERTY (e.g., French) keyboard. | |
Key | b B | 66 | b on a US keyboard. | |
Key | c C | 67 | c on a US keyboard. | |
Key | d D | 68 | d on a US keyboard. | |
Key | e E | 69 | e on a US keyboard. | |
Key | f F | 70 | f on a US keyboard. | |
Key | g G | 71 | g on a US keyboard. | |
Key | h H | 72 | h on a US keyboard. | |
Key | i I | 73 | i on a US keyboard. | |
Key | j J | 74 | j on a US keyboard. | |
Key | k K | 75 | k on a US keyboard. | |
Key | l L | 76 | l on a US keyboard. | |
Key | m M | 77 | m on a US keyboard. | |
Key | n N | 78 | n on a US keyboard. | |
Key | o O | 79 | o on a US keyboard. | |
Key | p P | 80 | p on a US keyboard. | |
Key | q Q | 81 | q on a US keyboard. Labelled a on an AZERTY (e.g., French) keyboard. | |
Key | r R | 82 | r on a US keyboard. | |
Key | s S | 83 | s on a US keyboard. | |
Key | t T | 84 | t on a US keyboard. | |
Key | u U | 85 | u on a US keyboard. | |
Key | v V | 86 | v on a US keyboard. | |
Key | w W | 87 | w on a US keyboard. Labelled z on an AZERTY (e.g., French) keyboard. | |
Key | x X | 88 | x on a US keyboard. | |
Key | y Y | 89 | y on a US keyboard. Labelled z on a QWERTZ (e.g., German) keyboard. | |
Key | z Z | 90 | z on a US keyboard. Labelled w on an AZERTY (e.g., French) keyboard, and y on a QWERTZ (e.g., German) keyboard. | |
Minus | - _ | 189 | -_ on a US keyboard. | |
Period | . > | 190 | .> on a US keyboard. | |
Quote | ' " | 222 | '" on a US keyboard. | |
Semicolon | ; : | 186 | ;: on a US keyboard. | |
Slash | / ? | 191 | /? on a US keyboard. | |
| Functional keys | ||||
Alt | Alt | 18 | Alt, Option or ⌥. | |
Alt | Alt | 18 | Alt, Option or ⌥. This is labelled AltGr key on many keyboard layouts. | |
Backspace | Backspace | 8 | Backspace or ⌫. Labelled Delete on Apple keyboards. | |
Caps | Caps | 20 | CapsLock or ⇪ | |
Context | Context | 93 | The application context menu key, which is typically found between the right Meta key and the right Control key. | |
Control | Control | 17 | Control or ⌃ | |
Control | Control | 17 | Control or ⌃ | |
Enter | Enter | 13 | Enter or ↵. Labelled Return on Apple keyboards. | |
Meta | Meta | 91 | The Windows, ⌘, Command or other OS symbol key. | |
Meta | Meta | 92 | The Windows, ⌘, Command or other OS symbol key. | |
Shift | Shift | 16 | Shift or ⇧ | |
Shift | Shift | 16 | Shift or ⇧ | |
Space | " " | 32 | ␣ (space) | |
Tab | Tab | 9 | Tab or ⇥ | |
| Japanese and Korean keys | ||||
Convert | Convert | 28 | Japanese: 変換 (henkan) | |
Kana | Kana | — | Japanese: カタカナ/ひらがな/ローマ字 (katakana/hiragana/romaji) | |
Lang1optional | — | Korean: HangulMode 한/영 (han/yeong); Japanese (Mac keyboard): かな (kana) | ||
Lang2optional | — | Korean: Hanja 한자 (hanja); Japanese (Mac keyboard): 英数 (eisu) | ||
Lang3optional | — | Japanese (word-processing keyboard): Katakana | ||
Lang4optional | — | Japanese (word-processing keyboard): Hiragana | ||
Lang5optional | — | Japanese (word-processing keyboard): Zenkaku/Hankaku | ||
Non | Non | 29 | Japanese: 無変換 (muhenkan) | |
| Control pad | ||||
Delete | Delete | 46 | ⌦. The forward delete key. Note that on Apple keyboards, the key labelled Delete on the main part of the keyboard should be encoded as "Backspace". | |
End | End | 35 | End or ↘ | |
Help | Help | — | Help. Not present on standard PC keyboards. | |
Home | Home | 36 | Home or ↖ | |
Insert | Insert | 45 | Insert or Ins. Not present on Apple keyboards. | |
Page | Page | 34 | Page Down, PgDn or ⇟ | |
Page | Page | 33 | Page Up, PgUp or ⇞ | |
| Arrow pad | ||||
Arrow | Arrow | 40 | ↓ | |
Arrow | Arrow | 37 | ← | |
Arrow | Arrow | 39 | → | |
Arrow | Arrow | 38 | ↑ | |
| Numpad | ||||
Num | Num | 144 | On the Mac, the "NumLock" code should be used for the numpad Clear key. | |
Numpad0 | 0 | 96 | 0 Ins on a keyboard; 0 on a phone or remote control | |
Numpad1 | 1 | 97 | 1 End on a keyboard; 1 or 1 QZ on a phone or remote control | |
Numpad2 | 2 | 98 | 2 ↓ on a keyboard; 2 ABC on a phone or remote control | |
Numpad3 | 3 | 99 | 3 PgDn on a keyboard; 3 DEF on a phone or remote control | |
Numpad4 | 4 | 100 | 4 ← on a keyboard; 4 GHI on a phone or remote control | |
Numpad5 | 5 | 101 | 5 on a keyboard; 5 JKL on a phone or remote control | |
Numpad6 | 6 | 102 | 6 → on a keyboard; 6 MNO on a phone or remote control | |
Numpad7 | 7 | 103 | 7 Home on a keyboard; 7 PQRS or 7 PRS on a phone or remote control | |
Numpad8 | 8 | 104 | 8 ↑ on a keyboard; 8 TUV on a phone or remote control | |
Numpad9 | 9 | 105 | 9 PgUp on a keyboard; 9 WXYZ or 9 WXY on a phone or remote control | |
Numpad | + | 107 | + | |
Numpadoptional | — | Found on the Microsoft Natural Keyboard. | ||
Numpadoptional | — | C or AC (All Clear). Also for use with numpads that have a Clear key that is separate from the NumLock key. On the Mac, the numpad Clear key should always be encoded as "NumLock". | ||
Numpadoptional | — | CE (Clear Entry) | ||
Numpadoptional | , | — | , (thousands separator). For locales where the thousands separator is a "." (e.g., Brazil), this key may generate a .. | |
Numpad | . | 110 | . Del. For locales where the decimal separator is "," (e.g., Brazil), this key may generate a ,. | |
Numpad | / | 111 | / | |
Numpad | Enter | 13 | ||
Numpadoptional | = | — | = | |
Numpadoptional | — | # on a phone or remote control device. This key is typically found below the 9 key and to the right of the 0 key. | ||
Numpadoptional | — | M+ Add current entry to the value stored in memory. | ||
Numpadoptional | — | MC Clear the value stored in memory. | ||
Numpadoptional | — | MR Replace the current entry with the value stored in memory. | ||
Numpadoptional | — | MS Replace the value stored in memory with the current entry. | ||
Numpadoptional | — | M- Subtract current entry from the value stored in memory. | ||
Numpad | * | 106 | * on a keyboard. For use with numpads that provide mathematical operations (+, -, * and /). Use "NumpadStar" for the * key on phones and remote controls. | |
Numpadoptional | ( | — | ( Found on the Microsoft Natural Keyboard. | |
Numpadoptional | ) | — | ) Found on the Microsoft Natural Keyboard. | |
Numpadoptional | — | * on a phone or remote control device. This key is typically found below the 7 key and to the left of the 0 key. Use "NumpadMultiply" for the * key on numeric keypads. | ||
Numpad | - | 109 | - | |
| Function section | ||||
Escape | Escape | 27 | Esc or ⎋ | |
F1 | F1 | 112 | F1 | |
F2 | F2 | 113 | F2 | |
F3 | F3 | 114 | F3 | |
F4 | F4 | 115 | F4 | |
F5 | F5 | 116 | F5 | |
F6 | F6 | 117 | F6 | |
F7 | F7 | 118 | F7 | |
F8 | F8 | 119 | F8 | |
F9 | F9 | 120 | F9 | |
F10 | F10 | 121 | F10 | |
F11 | F11 | 122 | F11 | |
F12 | F12 | 123 | F12 | |
Fnoptional | Fn | — | Fn This is typically a hardware key that does not generate a separate code. Most keyboards do not place this key in the function section, but it is included here to keep it with related keys. | |
Fnoptional | Fn | — | FLock or FnLock. Function Lock key. Found on the Microsoft Natural Keyboard. | |
Print | Print | 44 | PrtScr SysRq or Print Screen | |
Scroll | Scroll | 145 | Scroll Lock | |
Pause | Pause | 19 | Pause Break | |
F13 … F24 | F13 … F24 | 124–135 | Keyboards with more than 12 function keys continue the pattern: "F" followed by the number. | |
| Media keys | ||||
Browseroptional | Browser | 166 | Some laptops place this key to the left of the ↑ key. | |
Browseroptional | Browser | 171 | ||
Browseroptional | Browser | 167 | Some laptops place this key to the right of the ↑ key. | |
Browseroptional | Browser | 172 | ||
Browseroptional | Browser | 168 | ||
Browseroptional | Browser | 170 | ||
Browseroptional | Browser | 169 | ||
Ejectoptional | Eject | — | Eject or ⏏. This key is placed in the function section on some Apple keyboards. | |
Launchoptional | 182 | Sometimes labelled My Computer on the keyboard | ||
Launchoptional | 183 | Sometimes labelled Calculator on the keyboard | ||
Launchoptional | Launch | 180 | ||
Mediaoptional | Media | 179 | ||
Mediaoptional | 181 | |||
Mediaoptional | Media | 178 | ||
Mediaoptional | Media | 176 | ||
Mediaoptional | Media | 177 | ||
Poweroptional | Power | — | This key is placed in the function section on some Apple keyboards, replacing the Eject key. | |
Sleepoptional | 95 | |||
Audiooptional | Audio | 174 | ||
Audiooptional | Audio | 173 | ||
Audiooptional | Audio | 175 | ||
Wakeoptional | Wake | — | ||
| Legacy and special | ||||
Hyperoptional | Hyper | — | ||
Superoptional | Super | — | ||
Turbooptional | — | |||
Abortoptional | — | |||
Resumeoptional | — | |||
Suspendoptional | — | |||
Againoptional | Again | — | Found on Sun’s USB keyboard. | |
Copyoptional | Copy | — | Found on Sun’s USB keyboard. | |
Cutoptional | Cut | — | Found on Sun’s USB keyboard. | |
Findoptional | Find | — | Found on Sun’s USB keyboard. | |
Openoptional | Open | — | Found on Sun’s USB keyboard. | |
Pasteoptional | Paste | — | Found on Sun’s USB keyboard. | |
Propsoptional | Props | — | Found on Sun’s USB keyboard. | |
Selectoptional | Select | — | Found on Sun’s USB keyboard. | |
Undooptional | Undo | — | Found on Sun’s USB keyboard. | |
Hiraganaoptional | Hiragana | — | Use for dedicated ひらがな key found on some Japanese word processing keyboards. | |
Katakanaoptional | Katakana | — | Use for dedicated カタカナ key found on some Japanese word processing keyboards. | |
Unidentified | — | This value code should be used when no other value given in this specification is appropriate. | ||
| keyCode | Key | code value | Defined by | Notes |
|---|---|---|---|---|
| 0 | (no code) | UI Events §7.3.1 (rule) | No legacy code for this key, or a keypress event in the split model. | |
| 3 | Cancel | Pause | Windows virtual-key code | Ctrl + Pause/Break on Windows (VK_CANCEL); key is "Cancel". |
| 8 | Backspace | Backspace | UI Events §7.3.3 (fixed) | |
| 9 | Tab | Tab | UI Events §7.3.3 (fixed) | |
| 12 | Clear | Numpad5, Num | Windows virtual-key code | Numpad 5 with Num Lock off (VK_CLEAR); the Clear key of Mac keyboards. |
| 13 | Enter | Enter, Numpad | UI Events §7.3.3 (fixed) | |
| 16 | Shift | Shift, Shift | UI Events §7.3.3 (fixed) | |
| 17 | Control | Control, Control | UI Events §7.3.3 (fixed) | |
| 18 | Alt / Option | Alt, Alt | UI Events §7.3.3 (fixed) | |
| 19 | Pause | Pause | Windows virtual-key code | |
| 20 | Caps | Caps | UI Events §7.3.3 (fixed) | |
| 21 | Kana | Kana, Lang1 | Windows virtual-key code | IME keys (VK_KANA, VK_HANGUL); values vary by platform. |
| 25 | Kanji | Lang2 | Windows virtual-key code | IME keys (VK_KANJI, VK_HANJA); values vary by platform. |
| 27 | Escape | Escape | UI Events §7.3.3 (fixed) | |
| 28 | Convert | Convert | Windows virtual-key code | Japanese keyboards (VK_CONVERT). |
| 29 | Non | Non | Windows virtual-key code | Japanese keyboards (VK_NONCONVERT). |
| 32 | Space | Space | UI Events §7.3.3 (fixed) | event.key is " " (a space character), not "Space". |
| 33 | Page | Page, Numpad9 | UI Events §7.3.3 (fixed) | Numpad 9 with Num Lock off reports it too. |
| 34 | Page | Page, Numpad3 | UI Events §7.3.3 (fixed) | Numpad 3 with Num Lock off reports it too. |
| 35 | End | End, Numpad1 | UI Events §7.3.3 (fixed) | Numpad 1 with Num Lock off reports it too. |
| 36 | Home | Home, Numpad7 | UI Events §7.3.3 (fixed) | Numpad 7 with Num Lock off reports it too. |
| 37 | Arrow | Arrow, Numpad4 | UI Events §7.3.3 (fixed) | |
| 38 | Arrow | Arrow, Numpad8 | UI Events §7.3.3 (fixed) | |
| 39 | Arrow | Arrow, Numpad6 | UI Events §7.3.3 (fixed) | |
| 40 | Arrow | Arrow, Numpad2 | UI Events §7.3.3 (fixed) | |
| 44 | Print | Print | Windows virtual-key code | Windows often keeps the keydown for screenshots; only keyup may reach the page. |
| 45 | Insert | Insert, Numpad0 | Windows virtual-key code | Numpad 0 with Num Lock off reports it too. |
| 46 | Delete | Delete, Numpad | UI Events §7.3.3 (fixed) | Numpad . with Num Lock off reports it too. |
| 48 | 0 | Digit0 | UI Events §7.3.1 (rule) | Digits of the main block: the ASCII code of the digit. |
| 49 | 1 | Digit1 | UI Events §7.3.1 (rule) | Digits of the main block: the ASCII code of the digit. |
| 50 | 2 | Digit2 | UI Events §7.3.1 (rule) | Digits of the main block: the ASCII code of the digit. |
| 51 | 3 | Digit3 | UI Events §7.3.1 (rule) | Digits of the main block: the ASCII code of the digit. |
| 52 | 4 | Digit4 | UI Events §7.3.1 (rule) | Digits of the main block: the ASCII code of the digit. |
| 53 | 5 | Digit5 | UI Events §7.3.1 (rule) | Digits of the main block: the ASCII code of the digit. |
| 54 | 6 | Digit6 | UI Events §7.3.1 (rule) | Digits of the main block: the ASCII code of the digit. |
| 55 | 7 | Digit7 | UI Events §7.3.1 (rule) | Digits of the main block: the ASCII code of the digit. |
| 56 | 8 | Digit8 | UI Events §7.3.1 (rule) | Digits of the main block: the ASCII code of the digit. |
| 57 | 9 | Digit9 | UI Events §7.3.1 (rule) | Digits of the main block: the ASCII code of the digit. |
| 59 | ; : | Semicolon | Firefox (Gecko) only | Firefox only (DOM_VK_SEMICOLON); other browsers report 186. |
| 61 | = + | Equal | Firefox (Gecko) only | Firefox only (DOM_VK_EQUALS); other browsers report 187. |
| 65 | A | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 66 | B | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 67 | C | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 68 | D | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 69 | E | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 70 | F | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 71 | G | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 72 | H | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 73 | I | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 74 | J | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 75 | K | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 76 | L | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 77 | M | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 78 | N | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 79 | O | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 80 | P | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 81 | Q | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 82 | R | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 83 | S | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 84 | T | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 85 | U | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 86 | V | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 87 | W | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 88 | X | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 89 | Y | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 90 | Z | Key | UI Events §7.3.1 (rule) | The ASCII code of the upper-case letter the key types, whatever the case. |
| 91 | Meta (left Windows key, ⌘) | Meta | Windows virtual-key code | VK_LWIN; Chrome and Safari also use 91 for the left ⌘ key. |
| 92 | Meta (right Windows key) | Meta | Windows virtual-key code | VK_RWIN on Windows. Chrome and Safari on macOS report 93 for the right ⌘ key. |
| 93 | Context | Context | Windows virtual-key code | VK_APPS (the menu key next to the right Ctrl). |
| 95 | Sleep | Sleep | Windows virtual-key code | |
| 96 | Numpad 0 | Numpad0 | Windows virtual-key code | With Num Lock on. |
| 97 | Numpad 1 | Numpad1 | Windows virtual-key code | With Num Lock on. |
| 98 | Numpad 2 | Numpad2 | Windows virtual-key code | With Num Lock on. |
| 99 | Numpad 3 | Numpad3 | Windows virtual-key code | With Num Lock on. |
| 100 | Numpad 4 | Numpad4 | Windows virtual-key code | With Num Lock on. |
| 101 | Numpad 5 | Numpad5 | Windows virtual-key code | With Num Lock on. |
| 102 | Numpad 6 | Numpad6 | Windows virtual-key code | With Num Lock on. |
| 103 | Numpad 7 | Numpad7 | Windows virtual-key code | With Num Lock on. |
| 104 | Numpad 8 | Numpad8 | Windows virtual-key code | With Num Lock on. |
| 105 | Numpad 9 | Numpad9 | Windows virtual-key code | With Num Lock on. |
| 106 | Numpad * | Numpad | Windows virtual-key code | |
| 107 | Numpad + | Numpad | Windows virtual-key code | |
| 109 | Numpad - | Numpad | Windows virtual-key code | |
| 110 | Numpad . | Numpad | Windows virtual-key code | With Num Lock on. |
| 111 | Numpad / | Numpad | Windows virtual-key code | |
| 112 | F1 | F1 | Windows virtual-key code | |
| 113 | F2 | F2 | Windows virtual-key code | |
| 114 | F3 | F3 | Windows virtual-key code | |
| 115 | F4 | F4 | Windows virtual-key code | |
| 116 | F5 | F5 | Windows virtual-key code | |
| 117 | F6 | F6 | Windows virtual-key code | |
| 118 | F7 | F7 | Windows virtual-key code | |
| 119 | F8 | F8 | Windows virtual-key code | |
| 120 | F9 | F9 | Windows virtual-key code | |
| 121 | F10 | F10 | Windows virtual-key code | |
| 122 | F11 | F11 | Windows virtual-key code | |
| 123 | F12 | F12 | Windows virtual-key code | |
| 124 | F13 | F13 | Windows virtual-key code | |
| 125 | F14 | F14 | Windows virtual-key code | |
| 126 | F15 | F15 | Windows virtual-key code | |
| 127 | F16 | F16 | Windows virtual-key code | |
| 128 | F17 | F17 | Windows virtual-key code | |
| 129 | F18 | F18 | Windows virtual-key code | |
| 130 | F19 | F19 | Windows virtual-key code | |
| 131 | F20 | F20 | Windows virtual-key code | |
| 132 | F21 | F21 | Windows virtual-key code | |
| 133 | F22 | F22 | Windows virtual-key code | |
| 134 | F23 | F23 | Windows virtual-key code | |
| 135 | F24 | F24 | Windows virtual-key code | |
| 144 | Num | Num | Windows virtual-key code | Mac keyboards have Clear in this place (12). |
| 145 | Scroll | Scroll | Windows virtual-key code | |
| 166 | Browser | Browser | Windows virtual-key code | |
| 167 | Browser | Browser | Windows virtual-key code | |
| 168 | Browser | Browser | Windows virtual-key code | |
| 169 | Browser | Browser | Windows virtual-key code | |
| 170 | Browser | Browser | Windows virtual-key code | |
| 171 | Browser | Browser | Windows virtual-key code | |
| 172 | Browser | Browser | Windows virtual-key code | |
| 173 | Audio | Audio, Minus | Windows virtual-key code | VK_VOLUME_MUTE — but Firefox also reports 173 for the - key (DOM_VK_HYPHEN_MINUS). |
| 174 | Audio | Audio | Windows virtual-key code | |
| 175 | Audio | Audio | Windows virtual-key code | |
| 176 | Media | Media | Windows virtual-key code | |
| 177 | Media | Media | Windows virtual-key code | |
| 178 | Media | Media | Windows virtual-key code | |
| 179 | Media | Media | Windows virtual-key code | |
| 180 | Launch | Launch | Windows virtual-key code | |
| 181 | Select media | Media | Windows virtual-key code | VK_LAUNCH_MEDIA_SELECT. |
| 182 | Launch application 1 | Launch | Windows virtual-key code | Often labelled My Computer. |
| 183 | Launch application 2 | Launch | Windows virtual-key code | Often labelled Calculator. |
| 186 | ; : | Semicolon | UI Events §7.3.4 (US layout) | Firefox: 59. |
| 187 | = + | Equal | UI Events §7.3.4 (US layout) | Firefox: 61. |
| 188 | , < | Comma | UI Events §7.3.4 (US layout) | |
| 189 | - _ | Minus | UI Events §7.3.4 (US layout) | Firefox: 173. |
| 190 | . > | Period | UI Events §7.3.4 (US layout) | |
| 191 | / ? | Slash | UI Events §7.3.4 (US layout) | |
| 192 | ` ~ | Backquote | UI Events §7.3.4 (US layout) | |
| 219 | [ { | Bracket | UI Events §7.3.4 (US layout) | |
| 220 | \ | | Backslash | UI Events §7.3.4 (US layout) | |
| 221 | ] } | Bracket | UI Events §7.3.4 (US layout) | |
| 222 | ' " | Quote | UI Events §7.3.4 (US layout) | |
| 224 | Meta (Gecko) | Meta, Meta | Firefox (Gecko) only | Gecko’s DOM_VK_META (“Meta key on Linux, Command key on Mac”). |
| 226 | \ | (ISO) | Intl | Windows virtual-key code | VK_OEM_102: the extra key between left Shift and Z on ISO keyboards. |
| 229 | Process (IME) | UI Events §7.3.1 (rule) | keydown while an input method (IME) or an on-screen keyboard is composing text. |
No match in this table — try another word, or one of the other tables.
* keyCode: the number Chrome, Edge and Safari report on a US layout (Windows virtual-key codes); Firefox reports 59, 61 and 173 for the ; = and - keys. “optional” marks values the specification does not require browsers to support. The key and code tables are taken from the W3C Recommendations UI Events KeyboardEvent key Values and UI Events KeyboardEvent code Values (notes shortened). Copyright © 2025 World Wide Web Consortium, under the W3C Software and Document License.
About the JavaScript Keycode Finder
Press any key and see exactly what the browser’s keydown event reports: event.key (the character or key name your layout produces), event.code (the physical key), the legacy keyCode and which, location (left, right or numpad), the modifier and lock keys, repeat and isComposing. Every press also gives you listener code to paste — JavaScript, TypeScript or a React hook — with the right modifier checks, and the matching aria-keyshortcuts value.
Below the tester are searchable tables of every key and code value in the W3C specifications and of the legacy keyCode numbers, so you can look up keys you cannot press: media keys, F13–F24, Japanese and Korean keys. Notes explain what is unusual about each event — input methods and keyCode 229, dead keys, layouts such as AZERTY, the numpad, AltGr and Option.
How to use it
- Click the Press a key box (or Tab to it) and press a key or a combination such as Ctrl + S.
- Read
event.key,event.codeandkeyCodeat the top and every property in the table below; Notes explain anything surprising about that key. - Choose how the listener code should match the key (by
key,codeor the legacykeyCode), the event, where to listen and the language, then press Copy. - For a key you cannot press, type its name (Enter, F13, MediaPlayPause, KeyQ…) under Look up a key, or search the reference tables.
Examples
Press Enter
key "Enter" · code "Enter" · keyCode 13 · location 0
The Enter key on the numeric keypad gives the same key and keyCode, but code "NumpadEnter" and location 3.
Press the key labelled A
key "a" · code "KeyQ" · keyCode 65
code names the position the key has on a US keyboard; key is what your layout types.
Press Ctrl + S
if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 's') {
event.preventDefault();
// Ctrl + S or ⌘ + S was pressed
}Testing Ctrl or ⌘ covers Windows, Linux and Mac; toLowerCase() keeps the shortcut working with Caps Lock on.
Type with a Japanese IME, or on an Android phone keyboard
key "Process" or "Unidentified" · keyCode 229 · isComposing true
Skip such keydown events in shortcuts and read the text from the input or compositionend event.
Common uses
- Finding the key or code value to test in a keyboard shortcut, a game control or a custom input.
- Debugging a shortcut that works on your keyboard but not on a colleague’s (layouts, Caps Lock, Option, AltGr).
- Porting old code that compares
keyCodenumbers toevent.keyandevent.code. - Checking what an IME or a phone keyboard sends before handling text input yourself.
- Writing the
aria-keyshortcutsvalue for a button that has a shortcut.
key, code or keyCode — which to use
- **
event.key** is what the key produces with the current layout and modifiers: a character ("a","A","é"," ") or a key name from the W3C list ("Enter","ArrowUp","Escape"). Use it for text and for shortcuts that should follow the letter printed on the key. - **
event.code** names the physical key after its place on a US keyboard ("KeyA","Digit1","ShiftRight","NumpadEnter"), whatever the layout. Use it for controls that depend on position, such as WASD in games. - **
keyCode,whichandcharCode** are deprecated numbers kept for old scripts. The UI Events specification fixes only some of them (Enter 13, Escape 27, Space 32, the arrows 37–40, letters and digits by their ASCII codes); the rest follow Windows virtual-key codes, and a few differ between browsers — Firefox reports 59, 61 and 173 for;=-where Chrome, Edge and Safari report 186, 187 and 189. Avoid them in new code.
Input methods, phone keyboards and keyCode 229
While an input method editor (IME) composes text — Japanese, Chinese or Korean input, and most phone keyboards — keydown events have key "Process" (or "Unidentified" on Android) and keyCode 229, and isComposing is true while a composition is open. Shortcuts should ignore those events: if (event.isComposing || event.keyCode === 229) return;. The text itself arrives in input events (event.data, event.inputType) and in compositionupdate and compositionend; the event log on this page shows that sequence when you type with an IME.
Keyboard layouts, AltGr and Option
code stays with the key’s position, so the key that types a on a French keyboard reports "KeyQ". key follows the layout, and Shift, AltGr and — on a Mac — Option change it: Shift + 1 types "!" on a US layout but "1" on a French one, and Option + S types "ß". On Windows, AltGr also sets both ctrlKey and altKey, so check event.getModifierState('AltGraph') before treating Ctrl + Alt as a shortcut. In Chrome and Edge the page also asks the Keyboard Map API (navigator.keyboard.getLayoutMap()) which character each key types on your layout.
aria-keyshortcuts
If a button or link has a keyboard shortcut, aria-keyshortcuts lets screen readers announce it. WAI-ARIA 1.2 asks for the modifier names of the key values specification (Control, Alt, Shift, Meta), modifiers first, and the key rather than the character Shift makes: Shift+5, not %. Use Plus for + and Space for the space bar. The tester writes the value for every combination you press.
Sources
Key and code values: the W3C Recommendations UI Events KeyboardEvent key Values and UI Events KeyboardEvent code Values; the tables on this page are taken from them under the W3C Software and Document License. Legacy keyCode rules and fixed values: W3C UI Events, §7.3 “Legacy key models”; the other numbers are Microsoft’s Windows virtual-key codes, and Firefox’s own values come from MDN’s keyCode reference. aria-keyshortcuts: WAI-ARIA 1.2.
Limitations
- The page only sees keys that the operating system and the browser pass on: system shortcuts (Alt + Tab, ⌘ + Tab, Ctrl + Alt + Del), Fn and some media keys never arrive, and browsers keep Ctrl/⌘ + W, T and N for themselves.
- Values come from your browser, keyboard and layout; another browser or system can report a different keyCode for the same key.
- Phone and tablet keyboards often report key "Unidentified" and keyCode 229 for every key; the typed text is shown from the input event instead.
- Keys chosen under Look up a key show the values a US keyboard typically sends, not a measurement.
- Tab is never captured, so keyboard users can always leave the box; its values are shown before the focus moves on.
Privacy
Everything happens in your browser. Key presses are shown on this page only and kept in memory while it is open; nothing is sent or stored. Only your snippet options are remembered on this device.
Frequently asked questions
What is the keyCode for Enter?
13, for both Enter keys. In new code test event.key === 'Enter'; to tell the numpad Enter apart, check event.code === 'NumpadEnter' (or event.location === 3).
What is the difference between event.key and event.code?
key is what the key types with the current layout and modifiers ("a", "A", "Enter"). code is the physical key, named after its position on a US keyboard ("KeyA"); it does not change with the layout, Shift or Caps Lock.
Why is keyCode deprecated?
Its numbers were never standardised for most keys: browsers took them from Windows virtual-key codes, some differ (Firefox uses 59 for the semicolon key where others use 186), and they cannot describe other layouts. key and code are defined by W3C specifications and supported by all current browsers.
Why does my keydown event say keyCode 229 or key "Unidentified"?
An input method or an on-screen keyboard is handling the key — for example Japanese or Chinese input, or Gboard on Android. Ignore those keydown events in shortcuts and read the typed text from the input event.
How do I detect Ctrl + S (or ⌘ + S on a Mac)?
In a keydown listener: if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 's') { event.preventDefault(); … }. Press Ctrl + S in the tester to get the complete listener with the options you need.
How do I tell the left and right Shift keys apart?
event.code is "ShiftLeft" or "ShiftRight", and event.location is 1 (left) or 2 (right). The same works for Ctrl, Alt and Meta.
Is anything I type recorded?
No. Key presses are shown on this page and kept in memory only while it is open; nothing is uploaded or saved.