stuyam/pressure

Pressure JS doesn't handle ZTE correctly

dantman opened this issue · 1 comments

I have a ZTE Z957, I think it's also known as the 2016 ZTE Grand X 4.
Operating system is Android 6.0.1
Browser is Chrome 65

  • When I visit https://pressurejs.com/ the page doesn't say that it has fallen back to the polyfill.
  • The pressure value does not change over time, instead I get a number when I touch and it resets to 0 when I release or slide my finger a millimetre away.
  • I do get different numbers when I touch with different pressures (i.e. lightly touching with the tip of my finger, tapping instantly jamming my finger into the screen, and touching with my thumb gives different results)
  • However the highest value (jamming my finger into the screen) is always below 0.2.
  • The "Force Touch (mouse)" area shows an error.
  • The "3D Touch (touch)" area exhibits the long press behaviour of the polyfill.
  • The "Pointer Events (pointer)" area behaves the same as "Targets All" (the behaviour I described before)

Here's a gif of me lightly touching, touching, jamming, using my thumb, holding my finger on the 3D touch, and then on the Pointer Events.
screen recording

Thanks for the feedback @dantman !
There are a few things happening here. The mouse and touch events are working properly. The mouse one is only targeting mouse devices, which you don't have, so it is saying unsupported. The touch one is seeing you are targeting touch events but don't have touch force value so it is reverting to the polyfill.

The target all and pointer are targeting the pointer event because that is what your device supports. It seems like your device is probably giving weird pointer event results. The pointer event supports just maps to the pointer event api so it seems like your device might not follow the pointer event pressure api exactly (this is all too common). A lot of devices give weird pressure values, Im not sure if there is a fix for it. If you can connect to dev tools and what pointer event pressure values you phone is giving that might be helpful.