A String system variable that contains the value of the last key typed.

The key variable is helpful for checking whether an ASCII key has been typed. For example, the expression key === "a" evaluates to true if the a key was typed and false if not. key doesn’t update for special keys such as LEFT_ARROW and ENTER. Use keyCode instead for special keys. The keyIsDown() function should be used to check for multiple different key presses at the same time.


Related References