|
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.
|