stuyam / pressure

:point_down::boom: JavaScript library for handling Force Touch, 3D Touch, and Pointer Pressure.
https://pressurejs.com
MIT License
2.91k stars 98 forks source link

Full support for Apple Pencil #31

Closed yanniks closed 7 years ago

yanniks commented 8 years ago

While it detects the pressure of the Apple Pencil if I don't use my finger at all, it does not work if I tap the button with my finger first. After that, the Pencils pressure detection is no longer supported until I refresh the page.


Please provide information about the device you are seeing the issue on Device is a 2016 iPad Pro 9,7" Operating system is iOS 9.3.1 Browser is Mobile Safari

stuyam commented 8 years ago

@yanniks unfortunately I do not own an iPad Pro or Apple Pencil. However I am trying to get my hands on one by weeks end to try to reproduce and fix the issue. Thanks for bringing this to my attention I'm excited about the future possibilities with the Apple Pencil.

I will report back soon!

stuyam commented 8 years ago

@yanniks I did some reasearch. So yeah you are right. The screen on the iPad Pro is not force touch sensitive, it is just the pencil itself that can determine the force. So if you click on the screen with your finger before the pencil, it will set a flag on the page that there is no support for pressure and everything else will fail.

It does this for performance reasons so it doesn't have to do tests on every press. As well as in general I made the assumption that if one thing on the page gets the "unsupported" block called then for consistency the rest of the page should too. For example if "unsupported" is called and you want to trigger something on the page that it is not supported, then on another press on something else it says that it is supported how does that affect it.

I'm considering adding a configuration that you can set so that pressure will be tested every time you click on a pressure enable object. Anyone have thoughts on this, would love to hear from you @yanniks what you think. Sorry this is a little confusing and has a lot of jargon 😜

stuyam commented 7 years ago

Being added in v2.0.0, support is tested on every click or press instead of once per page. So the issue mentioned in this thread won't be an issue in the future because it can fail from a finger click but then succeeded from the pencil if you switch between the two.