Chapter 14. Adding Keyboard Controls

React to a Key Press

When developing interactive environments, it can be easy to become focused on dealing with the mouse and forget about the other important input device attached to every computer — the keyboard. However, keyboard input can be just as important — if not more important — than mouse input.

There are many advantages to responding to keyboard input. First, not everyone can use a mouse. For example, people with motor skill disabilities and the blind or visually impaired cannot use a mouse. Second, any given computer can have only a single mouse in use, but there are at least 85 keys on most standard keyboards, and ones with numeric keypads can have at least 102 keys. Because your script can be written ...

Get ActionScript®: Your visual blueprint™ for creating interactive projects in Flash® CS4 Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.