javascript, is there a way to set a (smaller) threshold on touchmove event

536 Views Asked by At

At this moment my touch input device generates a touchmove event (after a touchstart event) AFTER a number of pixels have been moved (I think it's about 10 pixels) This means that when using this technique to draw with my finger on the canvas, the first part of a curve is always a straight line with length 10 pixels. I want a touchmove event after just 2 or 3 pixels after the touchstart event. Is there some sort of threshold I can manipulate?

1

There are 1 best solutions below

2
On

As soon as you receive a touchstart event, add a listener that records pointermove events, storing the event coordinates to an array.

Then, when you receive your touchmove event, you will have the pointer location history from when the touchstart was received.