INPUT /  OUTPUT /  LANGUAGE





onKeyDown, onKeyUp fields

Code field

Code carried out when a key is pressed or released.

Applies to...

Sample usage

Behaviour

A code field: holds code to be carried out each time the event happens. Add code after the tag is created with .push.

While the code runs, key holds a number identifying the key (not the character it types):

KeykeyKeykey
A to Z65 to 90Enter13
0 to 948 to 57Space32
Left, Up, Right, Down37 to 40Backspace8
Shift16Tab9
Ctrl17

Key events go to the tag the user is typing in, and also to the console. Use the console's onKeyDown to respond to keys anywhere.

See also