There are three types of keyboard events: keydown, keypress, and keyup. For most keys, Gecko dispatches a sequence of key events like this:
keydown
keypress
keyup
When the key is first pressed, the keydown event is sent.
If the key is not a modifier key, the keypress event is sent.
When the user releases the key, the keyup event is sent.
Key
event.key
event.code
Z
z (lowercase)
z
KeyZ
Shift+Z
Z (uppercase)
Last updated 6 years ago