Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. MouseEvent
  4. getModifierState()

MouseEvent: getModifierState() method

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨March 2019⁩.

TheMouseEvent.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.

SeeKeyboardEvent.getModifierState() for details.

Syntax

js
getModifierState(key)

Parameters

key

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

Return value

A boolean value.

Specifications

Specification
UI Events
# dom-mouseevent-getmodifierstate

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp