TouchStart and TouchEnd not called when swiching fingers

https://playcanvas.com/editor/scene/607211

I have the most simple script with touchevents.
If i remove a finger and put a finger on the screen at the same time, touchStart and touchEnd are not fired. It seems to asume that is the same finger that fires touchMove.

To be more clear.

  • Put finger in screen: touchStart is called.
  • Removed said finger and put another at the same time in another section of the screen: touchMove is called as if the first finger just moved really really fast. No touchEnd and no touchStart.

Maybe this is normal behavior or i m losing my mind. Either way, i m a loss.

Thanks in advance.

var TestTouch = pc.createScript('testTouch');

// initialize code called once per entity
TestTouch.prototype.initialize = function() {
    this.entity.element.on('touchstart', this.OnTouchStarted, this);
    this.entity.element.on('touchmove', this.OnTouchMoved, this);
    this.entity.element.on('touchend', this.OnTouchEnded, this);
    this.entity.element.on('touchcancel', this.OnTouchCanceled, this);
};

// update code called every frame
TestTouch.prototype.update = function(dt) {
};

TestTouch.prototype.OnTouchStarted = function(ev){
    console.log("started");
};

TestTouch.prototype.OnTouchMoved = function(ev){
    console.log("moved");
};

TestTouch.prototype.OnTouchEnded = function(ev){
    console.log("ended");
};

TestTouch.prototype.OnTouchCanceled = function(ev){
    console.log("canceled");
};

It’s very possible that the second finger is not detected as a new finger by the device and therefore returns the same touch id making it look like the finger has moved very quickly.

If this is a concern, I would check if the move distance is more than X, then treat it as the start of a new input.

1 Like