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.
Syntax
var twist = pointerEvent.twist;
Value
A long value representing the amount of twist applied to the pointer.
Example
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);
Specifications
| Specification | Status | Comment |
|---|---|---|
| Pointer Events – Level 2 The definition of 'twist' in that specification. |
Working Draft |
Browser compatibility
| Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|---|
| Basic support | 58 | (Yes) | No support[1] | (Yes) | 45 | No support |
| Feature | Android Webview | Chrome for Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|---|
| Basic support | 58 | 58 | (Yes) | No support[1] | (Yes) | 45 | No support |
[1] This feature was implemented in Firefox 54, and is currently hidden behind a flag — to enable it and experiment, go to about:config and enable dom.w3c_pointer_events.enabled.
See also
Document Tags and Contributors
Tags:
Contributors to this page:
jpmedley,
chrisdavidmills
Last updated by:
jpmedley,