From 276d1c039a62649df23c9a83556c41d3d3dc0861 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 22 May 2012 11:26:40 -0700 Subject: [PATCH] Fix setting of state within touchscreen events. --- src/main/resources/mouse.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/resources/mouse.js b/src/main/resources/mouse.js index 6b39a0a..96a18bb 100644 --- a/src/main/resources/mouse.js +++ b/src/main/resources/mouse.js @@ -604,6 +604,9 @@ Guacamole.Mouse.Touchscreen = function(element) { e.stopPropagation(); e.preventDefault(); + // Release button + guac_touchscreen.currentState.left = false; + // Fire release event when the last touch is released, if event defined if (e.touches.length == 0 && guac_touchscreen.onmouseup) guac_touchscreen.onmouseup(guac_touchscreen.currentState); @@ -619,8 +622,9 @@ Guacamole.Mouse.Touchscreen = function(element) { var touch = e.touches[0]; // Update state - guac_touchscreen.currentstate.x = touch.clientX; - guac_touchscreen.currentstate.y = touch.clientY; + guac_touchscreen.currentState.left = true; + guac_touchscreen.currentState.x = touch.clientX; + guac_touchscreen.currentState.y = touch.clientY; // Fire press event, if defined if (guac_touchscreen.onmousedown) @@ -638,8 +642,8 @@ Guacamole.Mouse.Touchscreen = function(element) { var touch = e.touches[0]; // Update state - guac_touchscreen.currentstate.x = touch.clientX; - guac_touchscreen.currentstate.y = touch.clientY; + guac_touchscreen.currentState.x = touch.clientX; + guac_touchscreen.currentState.y = touch.clientY; // Fire movement event, if defined if (guac_touchscreen.onmousemove) -- 1.7.10.4