mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 13:41:21 +00:00
Show/hide keyboard with three-finger tap.
This commit is contained in:
@@ -20,10 +20,8 @@
|
|||||||
// UI Definition
|
// UI Definition
|
||||||
var GuacamoleUI = {
|
var GuacamoleUI = {
|
||||||
|
|
||||||
/* Detection Constants */
|
/* Constants */
|
||||||
|
|
||||||
"LONG_PRESS_DETECT_TIMEOUT" : 800, /* milliseconds */
|
|
||||||
"LONG_PRESS_MOVEMENT_THRESHOLD" : 10, /* pixels */
|
|
||||||
"KEYBOARD_AUTO_RESIZE_INTERVAL" : 30, /* milliseconds */
|
"KEYBOARD_AUTO_RESIZE_INTERVAL" : 30, /* milliseconds */
|
||||||
|
|
||||||
/* UI Components */
|
/* UI Components */
|
||||||
@@ -185,6 +183,15 @@ GuacamoleUI.toggleKeyboard = function() {
|
|||||||
GuacamoleUI.display.style.opacity = "0.1";
|
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) {
|
function positionCentered(element) {
|
||||||
element.style.left =
|
element.style.left =
|
||||||
((GuacamoleUI.viewport.offsetWidth - element.offsetWidth) / 2
|
((GuacamoleUI.viewport.offsetWidth - element.offsetWidth) / 2
|
||||||
|
Reference in New Issue
Block a user