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