Pressing the keyboard keys will display the corresponding key information.
a string representing the key value of the key
a string with the code value of the physical key
Deprecated, not for use in new websites
a number representing the location of the key on the keyboard or other input device
Tips: Click to copy
Online keyboard key information tool, displaying key, code, keycode, location, modifiers and other key information of keyboard key events in web pages, and providing a key information query comparison table.
-
Keyboard locationsThe following constants identify which part of the keyboard the key event originates from. They are accessed as KeyboardEvent.DOM_KEY_LOCATION_STANDARD and so forth.
Constant Value Description DOM_KEY_LOCATION_STANDARD 0x00 The key described by the event is not identified as being located in a particular area of the keyboard; it is not located on the numeric keypad (unless it's the NumLock key), and for keys that are duplicated on the left and right sides of the keyboard, the key is, for whatever reason, not to be associated with that location. Examples include alphanumeric keys on the standard PC 101 US keyboard, the NumLock key, and the space bar. DOM_KEY_LOCATION_LEFT 0x01 The key is one which may exist in multiple locations on the keyboard and, in this instance, is on the left side of the keyboard. Examples include the left Control key, the left Command key on a Macintosh keyboard, or the left Shift key. DOM_KEY_LOCATION_RIGHT 0x02 The key is one which may exist in multiple positions on the keyboard and, in this case, is located on the right side of the keyboard. Examples include the right Shift key and the right Alt key (Option on a Mac keyboard). DOM_KEY_LOCATION_NUMPAD 0x03 The key is located on the numeric keypad, or is a virtual key associated with the numeric keypad if there's more than one place the key could originate from. The NumLock key does not fall into this group and is always encoded with the location DOM_KEY_LOCATION_STANDARD. Examples include the digits on the numeric keypad, the keypad's Enter key, and the decimal point on the keypad. -
Modifier Keys
Key Description Alt Alt (Option or ⌥ on macOS) Ctrl Ctrl Key Meta the Meta key (on Mac keyboards, the ⌘ Command key; on Windows keyboards, the Windows key ⊞) Shift Shift Key - KeyboardEvent MDN Reference
-
KeyboardEvent Reference Table
category key code keyCode location Main Area 1 Digit1 49 0 2 Digit2 50 0 3 Digit3 51 0 4 Digit4 52 0 5 Digit5 53 0 6 Digit6 54 0 7 Digit7 55 0 8 Digit8 56 0 9 Digit9 57 0 0 Digit0 48 0 a KeyA 65 0 b KeyB 66 0 c KeyC 67 0 d KeyD 68 0 e KeyE 69 0 f KeyF 70 0 g KeyG 71 0 h KeyH 72 0 i KeyI 73 0 j KeyJ 74 0 k KeyK 75 0 l KeyL 76 0 m KeyM 77 0 n KeyN 78 0 o KeyO 79 0 p KeyP 80 0 q KeyQ 81 0 r KeyR 82 0 s KeyS 83 0 t KeyT 84 0 u KeyU 85 0 v KeyV 86 0 w KeyW 87 0 x KeyX 88 0 y KeyY 89 0 z KeyZ 90 0 A KeyA 65 0 B KeyB 66 0 C KeyC 67 0 D KeyD 68 0 E KeyE 69 0 F KeyF 70 0 G KeyG 71 0 H KeyH 72 0 I KeyI 73 0 J KeyJ 74 0 K KeyK 75 0 L KeyL 76 0 M KeyM 77 0 N KeyN 78 0 O KeyO 79 0 P KeyP 80 0 Q KeyQ 81 0 R KeyR 82 0 S KeyS 83 0 T KeyT 84 0 U KeyU 85 0 V KeyV 86 0 W KeyW 87 0 X KeyX 88 0 Y KeyY 89 0 Z KeyZ 90 0 ` Backquote 192 0 - Minus 189 0 = Equal 187 0 Backspace Backspace 8 0 Tab Tab 9 0 [ BracketLeft 219 0 ] BracketRight 221 0 \ Backslash 220 0 CapsLock CapsLock 20 0 ; Semicolon 186 0 ' Quote 222 0 Enter Enter 13 0 Shift ShiftLeft 16 1 , Comma 188 0 . Period 190 0 / Slash 191 0 Shift ShiftRight 16 2 Control ControlLeft 17 1 Meta MetaLeft 91 1 Alt AltLeft 18 1 Space 32 0 Alt AltRight 18 2 Meta MetaRight 92 2 ContextMenu ContextMenu 93 0 Control ControlRight 17 2 ~ Backquote 192 0 ! Digit1 49 0 @ Digit2 50 0 # Digit3 51 0 $ Digit4 52 0 % Digit5 53 0 ^ Digit6 54 0 & Digit7 55 0 * Digit8 56 0 ( Digit9 57 0 ) Digit0 48 0 _ Minus 189 0 + Equal 187 0 { BracketLeft 219 0 } BracketRight 221 0 | Backslash 220 0 : Semicolon 186 0 " Quote 222 0 < Comma 188 0 > Period 190 0 ? Slash 191 0 Function Area Escape Escape 27 0 F1 F1 112 0 F2 F2 113 0 F3 F3 114 0 F4 F4 115 0 F5 F5 116 0 F6 F6 117 0 F7 F7 118 0 F8 F8 119 0 F9 F9 120 0 F10 F10 121 0 F11 F11 122 0 F12 F12 123 0 ScrollLock ScrollLock 145 0 Pause Pause 19 0 Control Area Insert Insert 45 0 Home Home 36 0 PageUp PageUp 33 0 Delete Delete 46 0 End End 35 0 PageDown PageDown 34 0 ArrowUp ArrowUp 38 0 ArrowLeft ArrowLeft 37 0 ArrowDown ArrowDown 40 0 ArrowRight ArrowRight 39 0 Number Area NumLock NumLock 144 0 / NumpadDivide 111 3 * NumpadMultiply 106 3 - NumpadSubtract 109 3 + NumpadAdd 107 3 Enter NumpadEnter 13 3 . NumpadDecimal 110 3 0 Numpad0 96 3 1 Numpad1 97 3 2 Numpad2 98 3 3 Numpad3 99 3 4 Numpad4 100 3 5 Numpad5 101 3 6 Numpad6 102 3 7 Numpad7 103 3 8 Numpad8 104 3 9 Numpad9 105 3