- var touch = e.touches[0];
- moveMouse(touch.pageX, touch.pageY);
+ // Handle single-touch movement gesture (touchpad mouse move)
+ if (e.touches.length == 1) {
+
+ // Get change in touch location
+ var touch = e.touches[0];
+ var delta_x = touch.pageX - last_touch_x;
+ var delta_y = touch.pageY - last_touch_y;
+
+ // Update mouse location
+ guac_mouse.currentState.x += delta_x;
+ guac_mouse.currentState.y += delta_y;
+
+ // FIXME: Prevent mouse from leaving screen
+
+ // Fire movement event, if defined
+ if (guac_mouse.onmousemove)
+ guac_mouse.onmousemove(guac_mouse.currentState);
+
+ // Update touch location
+ last_touch_x = touch.pageX;
+ last_touch_y = touch.pageY;
+
+ }