From 828c3d4835a32f1322576a3de64a00ccedadbf30 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 8 Nov 2012 11:16:44 -0800 Subject: [PATCH] Show/hide keyboard with three-finger tap. --- guacamole/src/main/webapp/scripts/interface.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/guacamole/src/main/webapp/scripts/interface.js b/guacamole/src/main/webapp/scripts/interface.js index a944b6a73..8e5b4cde9 100644 --- a/guacamole/src/main/webapp/scripts/interface.js +++ b/guacamole/src/main/webapp/scripts/interface.js @@ -20,10 +20,8 @@ // UI Definition var GuacamoleUI = { - /* Detection Constants */ + /* Constants */ - "LONG_PRESS_DETECT_TIMEOUT" : 800, /* milliseconds */ - "LONG_PRESS_MOVEMENT_THRESHOLD" : 10, /* pixels */ "KEYBOARD_AUTO_RESIZE_INTERVAL" : 30, /* milliseconds */ /* UI Components */ @@ -185,6 +183,15 @@ GuacamoleUI.toggleKeyboard = function() { GuacamoleUI.display.style.opacity = "0.1"; }; + // Detect three-finger tap + GuacamoleUI.display.addEventListener('touchstart', function(e) { + + // If three touches, toggle keyboard + if (e.touches.length == 3) + GuacamoleUI.toggleKeyboard(); + + }, true); + function positionCentered(element) { element.style.left = ((GuacamoleUI.viewport.offsetWidth - element.offsetWidth) / 2