Move your mouse within this area while pressing one or more keyboard modifier keys.
The keys you have pressed will appear in bold.
- Alt
- Control
- Meta
- Shift
- AltGraph
Available in Chrome 47+ | View on GitHub | Browse Samples
The MouseEvent.getModifierState()
method returns information about which
modifier keys were pressed at the
time a MouseEvent
was fired.
While the demo below illustrates its use with the mousemove
event, any event that
uses the MouseEvent
interface
supports getModifierState()
.
Move your mouse within this area while pressing one or more keyboard modifier keys.
The keys you have pressed will appear in bold.