The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
getModifierState method
Queries the state of the specified modifier key.
![]() ![]() |
Syntax
object.getModifierState(keyArg, state)Parameters
- keyArg [in]
-
Type: String
- state [out, retval]
-
Type: Boolean
true if the modifier key is active; otherwise, false.
Return value
Type: Boolean
true if the modifier key is active; otherwise, false.
Standards information
- Document Object Model (DOM) Level 3 Events Specification, Section 5.2.6
Remarks
Some keyboard configurations contain a left and right modifier key. To determine whether the left or right key is pressed, use the location property.
See also
- DragEvent
- KeyboardEvent
- MouseEvent
- MouseWheelEvent
- WheelEvent
- Reference
- altKey
- ctrlKey
- metaKey
- shiftKey
Show:

