Trapping Keystrokes

Events

keyDown and keyUp are what you should be using. `keyPress` is not recommended according to MDN

KeyboardEvent object

To know which key was pressed, use key.

The possible values for `key` are listed in the first column from MDN Key Values page.

Deprecated properties or not recommended