JavaScript Key Code 18

18

Key Code Information

event.key

Alt
The value of the key pressed. Accounts for modifiers keys that return CAPS and alternate chars.

event.location

Left-side modifier keys
Some keys exist more than once on your keyboard. This provides the location of the key pressed. Try it with both shifts.

event.code

AltLeft
The physical key on the keyboard. Doesn't care if you are holding a modifier like Shift.

event.which

18
event.which and event.keyCode are deprecated in modern browsers. Use .key or .code instead.

Description

Alt / Option
This is the description we have created. Think it can be improved? PR us on GitHub

Meta Keys

^

Event Dump

{
 "key": "Alt",
 "keyCode": 18,
 "which": 18,
 "code": "AltLeft",
 "location": 1,
 "altKey": true,
 "ctrlKey": false,
 "metaKey": true,
 "shiftKey": false,
 "description": "Alt / Option",
 "unicode": "⎇ / ⌥",
 "path": "/alt-left"
}

Similar Values

Unicode

⎇ / ⌥

History