MouseEvent: getModifierState() method
The MouseEvent.getModifierState()
method returns the current state of the specified modifier key: true
if the modifier is active (i.e., the modifier key is pressed or locked), otherwise, false
.
See KeyboardEvent.getModifierState()
for details.
Syntax
Parameters
-
key
-
A modifier key value. The value must be one of the KeyboardEvent.key
values which represent modifier keys or "Accel"
Deprecated . This is case-sensitive.
Return value
Specifications
Browser compatibility
|
Desktop |
Mobile |
|
Chrome |
Edge |
Firefox |
Internet Explorer |
Opera |
Safari |
WebView Android |
Chrome Android |
Firefox for Android |
Opera Android |
Safari on IOS |
Samsung Internet |
getModifierState |
47 |
12 |
15 |
9 |
34 |
12.1 |
47 |
47 |
15 |
34 |
12.2 |
5.0 |
accel_support |
No |
No |
32 |
No |
No |
No |
No |
No |
32 |
No |
No |
No |
See also