Show/hide keyboard with three-finger tap.

This commit is contained in:
Michael Jumper
2012-11-08 11:16:44 -08:00
parent ce180d828b
commit 828c3d4835

View File

@@ -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