The twist
read-only property of the PointerEvent
interface represents the clockwise rotation of the transducer (e.g. pen stylus) around its major axis in degrees, with a value in the range 0 to 359.
For devices that do not report twist
, the value MUST be 0.
var twist = pointerEvent.twist;
A long value representing the amount of twist applied to the pointer.
When a pointerdown
event is fired, different functions are called depending on the value of the event's twist
property.
someElement.addEventListener('pointerdown', function(ev) { if (ev.twist == 0) { // No twist process_no_twist(ev); } else { // Default process_twist(ev); } }, false);
Specification | Status | Comment |
---|---|---|
Pointer Events – Level 2 The definition of 'twist' in that specification. | Working Draft |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 58 | No | 59
|
No | 45 | No |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | 58 | 58 | No | No
|
45 | No | 7.0 |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/twist