|
October 24, 1999 Keyboard-Triggered Events Tips: October 1999
Yehuda Shiran, Ph.D.
|
|
There are two basic ways to interact with the user. The common way is through the mouse and the onClick event. Another way to interact with an application is through the keyboard. The advantage of the keyboard interface is that it includes over a hundred different key variations, and each may have a different role in controlling the application. The event handler of a key press is onKeyPress. In our Snakes game we used the numeric key pad to control the snake's movement. The onKeyPress event handler is specified in the <BODY> tag:
The
Notice how we detect the browser type. The
People who read this tip also read these tips: Look for similar tips by subject: |