Keyboard Events

Determining which key is press is done via the event's "key" property.
The String's fromCharCode method translates this value into a letter.
In this example,you can move the layer by pressing 2,4,6 or 8.

An important aspect of this is the passing of the event object.
If you look at the source (press "s"),you'll notice that "evt" is the
argument used in the first parameter for the function that gets called.
This is how the event object is passed.

div1