Detecting The Shift/Ctrl/Alt Keys

Demonstrates a technique for detecting the shift, ctrl and alt keys:

+ The keydown listener sets shiftMode to true when event.keyCode == 16.
+ The keyup listener sets shiftMode to false when event.keyCode == 16.
+ The keypress listener now knows if the shift key is currently pressed.


Source
View
Rating
Size of active file
Submitted day

Cross-Browser
82
- 0 vote
5.79 KBytes
30/01/2007