JavaScript key codes are needed when writing code expected to handle
keyboard input.
You should check both of the following values as
onkeyup /
onkeydown and
onkeypress handle the
control and shift keys differently.
To see these in use, see the
initialization and
ship code for a
defender like game.