|
October 21, 2000 Probing the Left ALT Key Tips: October 2000
Yehuda Shiran, Ph.D.
|
|
Starting with IE 5.5, you can set and retrieve the status of the left alt key. You can detect its status by probing event.altLeft. It is true when the key is pressed, false otherwise. You can also set event.altKey. This property is currently supported only in NT and Windows 2000. When you try it in Windows 95/98, the response will be as if the Right ALT key is pressed.
You have to make sure that the document has focus. You can make sure of it by calling
Try pressing the Left ALT key. You will get an alert, showing the pressed key. You should get
The event handler is defined as:
Read more about events and event handling in Column 11, The Cross-Browser Event Model.
People who read this tip also read these tips: Look for similar tips by subject: |