PointerEvent.twist

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 2
The definition of 'twist' in that specification.
Working Draft  

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support 58Edge No support NoFirefox Full support 59
Full support 59
Full support 54
Disabled
Disabled From version 54: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE No support NoOpera Full support 45Safari No support NoWebView Android Full support 58Chrome Android Full support 58Edge Mobile No support NoFirefox Android No support No
No support No
Full support 54
Disabled
Disabled From version 54: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android Full support 45Safari iOS No support NoSamsung 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

Document Tags and Contributors

Contributors to this page: mfluehr, lpd-au, jpmedley, chrisdavidmills
Last updated by: mfluehr,