Changeset 73ff5ff in guacamole-common-js
- Timestamp:
- 04/09/12 16:57:58 (14 months ago)
- Branches:
- master, guacamole-debian-parent, unstable
- Children:
- 6fe74a6
- Parents:
- 6701f31
- git-author:
- Michael Jumper <zhangmaike@…> (04/09/12 16:57:58)
- git-committer:
- Michael Jumper <zhangmaike@…> (04/09/12 16:57:58)
- File:
-
- 1 edited
-
src/main/resources/mouse.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/main/resources/mouse.js
ra5b79eb r73ff5ff 164 164 var last_touch_time = 0; 165 165 var pixels_moved = 0; 166 var touch_distance = 0;167 166 168 167 var touch_buttons = { … … 177 176 element.addEventListener("touchend", function(e) { 178 177 178 cancelEvent(e); 179 179 180 // If we're handling a gesture AND this is the last touch 180 181 if (gesture_in_progress && e.touches.length == 0) { 181 182 cancelEvent(e);183 182 184 183 var time = new Date().getTime(); … … 221 220 guac_mouse.onmouseup(guac_mouse.currentState); 222 221 223 // Allow mouse events now that touching isover222 // Gesture now over 224 223 gesture_in_progress = false; 225 224 226 225 }, guac_mouse.clickTimingThreshold); 227 226 228 227 } 229 228 229 // If we're not waiting to see if this is a click, stop gesture 230 if (!click_release_timeout) 231 gesture_in_progress = false; 232 230 233 } 231 234 … … 233 236 234 237 element.addEventListener("touchstart", function(e) { 238 239 cancelEvent(e); 235 240 236 241 // Track number of touches, but no more than three 237 242 touch_count = Math.min(e.touches.length, 3); 238 243 244 // Clear timeout, if set 245 if (click_release_timeout) { 246 window.clearTimeout(click_release_timeout); 247 click_release_timeout = null; 248 } 249 239 250 // Record initial touch location and time for touch movement 240 251 // and tap gestures 241 if (e.touches.length == 1) { 242 243 cancelEvent(e); 252 if (!gesture_in_progress) { 244 253 245 254 // Stop mouse events while touching 246 255 gesture_in_progress = true; 247 248 // Clear timeout, if set249 if (click_release_timeout) {250 window.clearTimeout(click_release_timeout);251 click_release_timeout = null;252 }253 256 254 257 // Record touch location and time
Note: See TracChangeset
for help on using the changeset viewer.
