MouseEvent: getModifierState() メソッド
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
MouseEvent.getModifierState()
メソッドは、指定された修飾キーの現在の状態を返します。修飾キーが有効(すなわち、修飾キーが押されているかロックされている)ならば true
、そうでなければ false
を返します。
詳しくは KeyboardEvent.getModifierState()
を参照してください。
構文
js
getModifierState(key)
引数
key
-
修飾キーの値です。 値は修飾キーを表す
KeyboardEvent.key
値のいずれか、または"Accel"
非推奨; である必要があります。 これは大文字と小文字を区別します。
返値
論理値です。
仕様書
Specification |
---|
UI Events # dom-mouseevent-getmodifierstate |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
getModifierState | ||||||||||||
"Accel" parameter |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- Non-standard. Check cross-browser support before using.
- Deprecated. Not for use in new websites.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.