mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	Fix show/hide of OSK.
This commit is contained in:
		| @@ -412,6 +412,10 @@ GuacUI.Client.OnScreenKeyboard = function() { | |||||||
|             updateKeyboardSize, |             updateKeyboardSize, | ||||||
|             GuacUI.Client.KEYBOARD_AUTO_RESIZE_INTERVAL); |             GuacUI.Client.KEYBOARD_AUTO_RESIZE_INTERVAL); | ||||||
|  |  | ||||||
|  |         // Resize on window resize | ||||||
|  |         window.addEventListener("resize", updateKeyboardSize, true); | ||||||
|  |  | ||||||
|  |         // Initialize size | ||||||
|         updateKeyboardSize(); |         updateKeyboardSize(); | ||||||
|  |  | ||||||
|     }; |     }; | ||||||
| @@ -421,6 +425,7 @@ GuacUI.Client.OnScreenKeyboard = function() { | |||||||
|         // Hide keyboard |         // Hide keyboard | ||||||
|         document.body.removeChild(keyboard_container); |         document.body.removeChild(keyboard_container); | ||||||
|         window.clearInterval(keyboard_resize_interval); |         window.clearInterval(keyboard_resize_interval); | ||||||
|  |         window.removeEventListener("resize", updateKeyboardSize, true); | ||||||
|  |  | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -104,6 +104,13 @@ GuacUI.StateManager = new (function() { | |||||||
|  |  | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * Returns the current visible state. | ||||||
|  |      */ | ||||||
|  |     this.getState = function() { | ||||||
|  |         return current_state; | ||||||
|  |     }; | ||||||
|  |  | ||||||
| })(); | })(); | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -297,8 +297,17 @@ GuacamoleUI.attach = function(guac) { | |||||||
|         // If lifting up on shift, toggle keyboard if rest of gesture |         // If lifting up on shift, toggle keyboard if rest of gesture | ||||||
|         // conditions satisfied |         // conditions satisfied | ||||||
|         if (show_keyboard_gesture_possible && keysym == 0xFFE1) { |         if (show_keyboard_gesture_possible && keysym == 0xFFE1) { | ||||||
|             if (keyboard.pressed[0xFFE3] && keyboard.pressed[0xFFE9]) |             if (keyboard.pressed[0xFFE3] && keyboard.pressed[0xFFE9]) { | ||||||
|  |  | ||||||
|  |                 // If in INTERACTIVE mode, switch to OSK | ||||||
|  |                 if (GuacUI.StateManager.getState() == GuacUI.Client.states.INTERACTIVE) | ||||||
|                     GuacUI.StateManager.setState(GuacUI.Client.states.OSK); |                     GuacUI.StateManager.setState(GuacUI.Client.states.OSK); | ||||||
|  |  | ||||||
|  |                 // If in OSK mode, switch to INTERACTIVE  | ||||||
|  |                 else if (GuacUI.StateManager.getState() == GuacUI.Client.states.OSK) | ||||||
|  |                     GuacUI.StateManager.setState(GuacUI.Client.states.INTERACTIVE); | ||||||
|  |  | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         // Detect if no keys are pressed |         // Detect if no keys are pressed | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user