twist 只读特性在 PointerEvent interface represents the clockwise rotation of the pointer (e.g., pen stylus) around its major axis, in degrees.

句法

var twist = pointerEvent.twist;
					

返回值

A long value representing the amount of twist, in degrees, applied to the transducer (pointer). The value is in the range 0 to 359 , inclusive. For devices that do not report twist , the value is 0 .

范例

pointerdown event is fired, different functions are called depending on the value of the event's twist 特性。

someElement.addEventListener('pointerdown', function(event) {
  if (event.twist == 0) {
    // No twist
    process_no_twist(event);
  } else {
    // Default
    process_twist(event);
  }
}, false);
					

规范

规范 状态 注释
指针事件 – 2 级
The definition of 'twist' in that specification.
推荐

浏览器兼容性

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.

更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
twist Chrome 58 Edge 18 Firefox 59
59
Disabled ). To change preferences in Firefox, visit
IE No Opera 45 Safari 13 WebView Android 58 Chrome Android 58 Firefox Android 54 Opera Android 43 Safari iOS 13 Samsung Internet Android 7.0

图例

完整支持

完整支持

不支持

不支持

用户必须明确启用此特征。

用户必须明确启用此特征。

另请参阅

元数据

  • 最后修改: