MouseEvent: getModifierState() method
Pointer Events
Pointer Events
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
```js-nolint
getModifierState(key)
```
### Parameters
- `key`
- : A modifier key value.
The value must be one of the KeyboardEvent.key values which represent modifier keys or `"Accel"` .
This is case-sensitive.
### Return value
A boolean value.
## Specifications
## Browser compatibility
## See also
- The MouseEvent this method belongs to.
- KeyboardEvent.getModifierState
source: MDN Web Docs mirror · page
Cite this
"MouseEvent: getModifierState() method". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/getModifierState JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy