From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/mouseevent/which/index.html | 99 +++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 files/zh-cn/web/api/mouseevent/which/index.html (limited to 'files/zh-cn/web/api/mouseevent/which') diff --git a/files/zh-cn/web/api/mouseevent/which/index.html b/files/zh-cn/web/api/mouseevent/which/index.html new file mode 100644 index 0000000000..591412dda3 --- /dev/null +++ b/files/zh-cn/web/api/mouseevent/which/index.html @@ -0,0 +1,99 @@ +--- +title: MouseEvent.which +slug: Web/API/MouseEvent/which +tags: + - API + - 只读 + - 非标准 + - 鼠标事件 +translation_of: Web/API/MouseEvent/which +--- +

{{APIRef("DOM Events")}}

+ +

{{Non-standard_header}}

+ +

只读属性 MouseEvent.which 显示了鼠标事件是由哪个鼠标按键被按下所触发的。其他获得该信息的标准属性是 {{ domxref("MouseEvent.button") }} 与 {{ domxref("MouseEvent.buttons") }} 。

+ +

语法

+ +
var buttonPressed = instanceOfMouseEvent.which
+
+ +

返回值

+ +

表示一个特定按键的数字:

+ + + +

如果鼠标被设置为适用于左利手人士使用,那么引发的动作恰好相反。在这种情况下,该值应该从右往左看。

+ +

规范

+ +

无规范定义该属性。

+ +

浏览器兼容性

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureEdgeFirefox (Gecko)ChromeInternet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatGeckoDesktop(1)}}[1]1.09.05.01.0
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureEdgeFirefox Mobile (Gecko)AndroidIE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{ CompatGeckoMobile(1) }} [1]{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

[1] 在 {{event("mousemove")}} 事件对象上, which 属性被错误地设定为 1 {{bug(1048294)}}.

+ +

相关内容

+ + -- cgit v1.2.3-54-g00ecf