Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. PointerEvent
  4. tangentialPressure

PointerEvent: tangentialPressure property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2020⁩.

ThetangentialPressure read-only property of thePointerEvent interface represents the normalized tangential pressure ofthe pointer input (also known as barrel pressure orcylinder stress).

Value

Afloat representing the normalized tangential pressure of the pointerinput in the range-1 to1, inclusive, where0 isthe neutral position of the control.

Note that some hardware may only support positive values in the range0 to1. For hardware that does not support tangential pressure, the value willbe0.

Examples

In this snippet, when apointerdown event is fired, different functionsare called depending on the value of the event'stangentialPressureproperty.

js
someElement.addEventListener("pointerdown", (event) => {  if (event.tangentialPressure === 0) {    // No pressure    process_no_tanPressure(event);  } else if (event.tangentialPressure === 1) {    // Maximum pressure    process_max_tanPressure(event);  } else {    // Default    process_tanPressure(event);  }});

Specifications

Specification
Pointer Events
# dom-pointerevent-tangentialpressure

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp