Search code examples
javascriptwebtouchtablet

How to measure the force of pressure on the Web?


Recently Apple introduced a new trackpad, which supports the "Force Touch" feature. It is similar to Wacom tablets for painting because, with special software, you can measure the force (weight) of pressing.
So, is it possible to get these values using web-technologies like javascript? Do browsers provide any API and information about pressing force?

P.S. I find this question relative to mine one, but it is not about the web: Android, IOS force pressing on the screen


Solution

  • You're looking for the pressure attribute of a PointerEvent. This isn't widely supported across browsers yet, as it's not a final spec, but as of this writing IE11 has some support.