PointerEvent.tangentialPressure

The tangentialPressure read-only property of the PointerEvent interface represents the normalized tangential pressure of the pointer input (also known as barrel pressure or cylinder stress) in the range -1 to 1, where 0 is the neutral position of the control.

Note that some hardware may only support positive values in the range 0 to 1. For hardware that does not support tangential pressure, the value will be 0.

Syntax

var tanPressure = pointerEvent.tangentialPressure;

Value

A float representing the amount of tangential pressure applied to the pointer.

Example

When a pointerdown event is fired, different functions are called depending on the value of the event's tangentialPressure property.

someElement.addEventListener('pointerdown', function(ev) {
   if (ev.tangentialPressure == 0) {
     // No pressure
     process_no_tanPressure(ev);
   } else if (ev.tangentialPressure == 1) {
     // Maximum pressure
     process_max_tanPressure(ev);
   } else {
     // Default
     process_tanPressure(ev);
   }
 }, false);

Specifications

Specification Status Comment
Pointer Events – Level 2
The definition of 'tangentialPressure' in that specification.
Working Draft  

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung 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: lpd-au, jpmedley, chrisdavidmills
Last updated by: lpd-au,