MouseEvent.getModifierState()

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(keyArg)

Returns

A boolean value

Parameters

keyArg

A modifier key value. The value must be one of the KeyboardEvent.key values which represent modifier keys or "Accel" . This is case-sensitive.

Specifications

Specification
UI Events
# dom-mouseevent-getmodifierstate

Browser compatibility

BCD tables only load in the browser

See also