r/javascript • • Feb 19 '18

Pressure - a JavaScript library for handling Force Touch, 3D Touch, and Pointer Pressure on the web, bundled under one library with a simple API that makes working with them painless

https://pressurejs.com/
343 Upvotes

13 comments sorted by

12

u/FishyOS Feb 19 '18

Cool idea. I can’t think of a use for it yet in my projects, but I’m glad to know someone’s made utilizing it simple.

5

u/Tinpotray Feb 19 '18

Nice! Thanks for sharing OP!

I’d love to see a Cordova plugin for this to use with Ionic.

2

u/BlueHeartBob Feb 19 '18

Wacom tablet doesn't quite work. But it's not like i'm browsing the web with it anyways.

1

u/yamartino Feb 24 '18

you need to download the driver for your computer for the Wacom tablet. Then it will work in browsers, it doesn't work out of the box unfortunately.

1

u/BlueHeartBob Feb 24 '18

I have the drivers installed lol.

1

u/yamartino Feb 24 '18

oh awesome! what is happening when you use the tablet? what isn't working? we can open an issue pressure if it isn't working. also may be a limitation of what the browser is passing in, the APIs are finicky and support is sparse :/

2

u/[deleted] Feb 19 '18

Sick!

2

u/evenisto Feb 20 '18

Huh, I had no idea force touch/3d touch browser events existed.

1

u/ParadoxDC Feb 19 '18

This is fantastic. Thanks.

0

u/[deleted] Feb 19 '18

[deleted]

12

u/aapzu Feb 19 '18

It works with all devices, but if the device is not pressure sensitive it uses a polyfill (long press). The compatibility list is the devices which support pressure.

5

u/cazzer548 Feb 19 '18

All of the variable pressure examples do not work on other devices.

Edit: I'm using an S8

1

u/mrkantz Feb 19 '18

On a Note 8 and same result. Some of them kind of work with the S Pen, but it's not ideal.

1

u/Poor_iggy_ Feb 20 '18

works for all (of the 10+ listed) devices!

made with real cheese!

Yeah, like 5% real cheese.