web api instance method
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
getModifierState(key)
Parameters
key- : A modifier key value.
The value must be one of the
keyvalues which represent modifier keys or"Accel"Deprecated. This is case-sensitive.
- : A modifier key value.
The value must be one of the
Return value
A boolean value.
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.
See also
- The
MouseEventthis method belongs to. getModifierState