diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js index 62e6e74ca..d6385a975 100644 --- a/guacamole/src/main/webapp/app/client/controllers/clientController.js +++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js @@ -46,6 +46,11 @@ angular.module('home').controller('clientController', ['$scope', '$routeParams', // Hide menu by default $scope.menuShown = false; + + // Update the model when clipboard data received from client + $scope.$on('guacClientClipboard', function clipboardDataReceived(clipboardData) { + $scope.guacClipboard = clipboardData; + }); /* * Parse the type, name, and id out of the url paramteres, @@ -94,6 +99,17 @@ angular.module('home').controller('clientController', ['$scope', '$routeParams', return true; } + $scope.$watch('menuShown', function setKeyboardEnabled(menuShown, menuShownPreviousState) { + + // Send clipboard data if menu is hidden + if (!menuShown && menuShownPreviousState) { + $scope.$broadcast('guacClipboard', $scope.clipboardData); + } + + // Disable client keyboard if the menu is shown + $scope.clientProperties.keyboardEnabled = !menuShown; + }); + $scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) { keysCurrentlyPressed[keysym] = true; diff --git a/guacamole/src/main/webapp/app/client/directives/guacClient.js b/guacamole/src/main/webapp/app/client/directives/guacClient.js index 9eb2ce297..981c59029 100644 --- a/guacamole/src/main/webapp/app/client/directives/guacClient.js +++ b/guacamole/src/main/webapp/app/client/directives/guacClient.js @@ -114,12 +114,7 @@ angular.module('client').directive('guacClient', [function guacClient() { "emulate_absolute" : true, "touch" : null, "touch_screen" : null, - "touch_pad" : null, - - /* Clipboard */ - - "remote_clipboard" : "", - "clipboard_integration_enabled" : undefined + "touch_pad" : null }); var CLIENT_PROPERTY_DEFAULTS = { @@ -680,17 +675,21 @@ angular.module('client').directive('guacClient', [function guacClient() { // Listen for broadcasted keydown events and fire the appropriate listeners $scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) { - var preventDefault = $scope.keydown(keysym, keyboard); - if(preventDefault) { - event.preventDefault(); + if ($scope.clientProperties.keyboardEnabled) { + var preventDefault = $scope.keydown(keysym, keyboard); + if (preventDefault) { + event.preventDefault(); + } } }); // Listen for broadcasted keyup events and fire the appropriate listeners $scope.$on('guacKeyup', function keyupListener(event, keysym, keyboard) { - var preventDefault = $scope.keyup(keysym, keyboard); - if(preventDefault) { - event.preventDefault(); + if ($scope.clientProperties.keyboardEnabled) { + var preventDefault = $scope.keyup(keysym, keyboard); + if(preventDefault) { + event.preventDefault(); + } } }); diff --git a/guacamole/src/main/webapp/app/client/services/clientProperties.js b/guacamole/src/main/webapp/app/client/services/clientProperties.js index c31119860..26d867307 100644 --- a/guacamole/src/main/webapp/app/client/services/clientProperties.js +++ b/guacamole/src/main/webapp/app/client/services/clientProperties.js @@ -61,6 +61,13 @@ angular.module('client').factory('clientProperties', [function clientProperties( * @type Number */ this.maxScale = 3; + + /** + * Whether or not the client should listen to keyboard events. + * + * @type Boolean + */ + this.keyboardEnabled = true; }; }]); \ No newline at end of file diff --git a/guacamole/src/main/webapp/app/client/templates/client.html b/guacamole/src/main/webapp/app/client/templates/client.html index ff863f429..f25857803 100644 --- a/guacamole/src/main/webapp/app/client/templates/client.html +++ b/guacamole/src/main/webapp/app/client/templates/client.html @@ -46,8 +46,8 @@

{{'client.clipboard' | translate}}

-

- +

{{'client.copiedText' | translate}}

+