Hi James yes I can see there is some difference in behavior between MoI v3 and v4 , maybe v4 is sending events in some unexpected order. I'll see if I can find out what.
But part of the problem is it's based only on mouse oriented behavior - 2 fingers just lightly touching doesn't do panning at all right, it's only 2 fingers _clicked_ down and dragged that does panning. That it keeps panning until you remove both fingers from the click doesn't seem like a bug.
2 fingers lightly touching doesn't do any panning over here, only a mousewheel type zoom if you move up and down.
For a trackpad it's probably better for panning to work by 2 finger movement and zooming with pinching.
I see that in main.js there are some event handlers set up for touch events, but in the handler it's just translating these into mouse events and not handling them as drag/pinch gestures. It could be possible that MoI v3 being based on a older Webkit version did not fire these touch events and MoI v4 does and that's why there is different behavior.
Please give this a try - in the file main.js line 2738 where it sets up the multitouch event handlers, which looks like this:
code:
//touch events
this._touchpad_callback = this.bindFunction(this.touchHandler, this);
//if( 'touchstart' in document.documentElement ) {
canvas.addEventListener("touchstart", this._touchpad_callback, true);
canvas.addEventListener("touchmove", this._touchpad_callback, true);
canvas.addEventListener("touchend", this._touchpad_callback, true);
canvas.addEventListener("touchcancel", this._touchpad_callback, true);
//}
Comment out that whole block by adding /* */ around it so it looks like this:
code:
/*
//touch events
this._touchpad_callback = this.bindFunction(this.touchHandler, this);
//if( 'touchstart' in document.documentElement ) {
canvas.addEventListener("touchstart", this._touchpad_callback, true);
canvas.addEventListener("touchmove", this._touchpad_callback, true);
canvas.addEventListener("touchend", this._touchpad_callback, true);
canvas.addEventListener("touchcancel", this._touchpad_callback, true);
//}
*/
Then give that a try and see if you now have the same behavior in MoI v4 as v3 had.
Qt will automatically synthesize mouse events for touches if not already done, so it shouldn't be necessary to have an additional touch handler in HTML that just generates mouse events, that's probably making most of the odd behavior.
If that part is straightened out then maybe it's possible to add different handling for touch gestures to make it behave more trackpad like, like 2 fingers panning and pinching for zooming.
- Michael