I am trying to learn how to use the touchmove
event in browser to detect multitouch gestures. When a touchmove event is captured I can obtain a list of current touch points. However that is not very useful for detecting gestures. I like to get the history of the touch event. For example I want to get a list of last 10 touch points (if available) that came before each current distinct touch point. I draw the figure below in an attempt to visualize what I am after:
As I said in this scenario where the user is dragging two seperate fingers on the screen in two different patterns (fingers from different hands), I receive only two touch points inside the touchmove
event. Is it possible to access history of where each of the two points have been before they got to the point A and B?
Here is the relevant bit of code for capturing the touchmove
event:
document.addEventListener('touchmove', touchMove, false);
function touchMove(e) {
console.log("length is: ", e.touches.length);
e.preventDefault();
}
Please do not suggest third party libraries -- my goal is to learn how to define and detect my own custom true multitouch gestures.