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 the document of KeyboardEvent.getModifierState() for details.

语法

var active =​ event.getModifierState(keyArg);

返回值

A Boolean

参数

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.

规范

Specification Status Comment
Document Object Model (DOM) Level 3 Events Specification
getModifierState()
Obsolete Initial definition.

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support 47Edge Full support YesFirefox ? IE ? Opera ? Safari ? WebView Android Full support 47Chrome Android Full support 47Edge Mobile Full support YesFirefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?
"Accel" parameter
DeprecatedNon-standard
Chrome No support NoEdge ? Firefox ? IE ? Opera ? Safari ? WebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.

See also

文档标签和贡献者

此页面的贡献者: fengchunsgit
最后编辑者: fengchunsgit,