The twist
read-only property of the PointerEvent
interface represents the clockwise rotation of the pointer (e.g., pen stylus) around its major axis, in degrees.
Syntax
var twist = pointerEvent.twist;
Return value
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
.
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(event) {
if (event.twist == 0) {
// No twist
process_no_twist(event);
} else {
// Default
process_twist(event);
}
}, false);
Specifications
Specification | Status | Comment |
Pointer Events – Level 2The definition of 'twist' in that specification. | Recommendation |
Browser compatibility
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.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
twist
|
Chrome
Full support 58 |
Edge
Full support 18 |
Firefox Full support 59 Full support 59 Full support 54 Disabled' From version 54: this feature is behind the |
IE
No support No |
Opera
Full support 45 |
Safari
Full support 13 |
WebView Android
Full support 58 |
Chrome Android
Full support 58 |
Firefox Android Full support 54 Full support 54 Disabled' From version 54: this feature is behind the |
Opera Android
Full support 43 |
Safari iOS
Full support 13 |
Samsung Internet Android
Full support 7.0 |
Legend
- Full support
- Full support
- No support
- No support
- User must explicitly enable this feature.'
- User must explicitly enable this feature.
See also
PointerEvent.twist by Mozilla Contributors is licensed under CC-BY-SA 2.5.