diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js index 62707b902..af6572b04 100644 --- a/guacamole/src/main/webapp/app/client/controllers/clientController.js +++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js @@ -76,6 +76,9 @@ angular.module('home').controller('clientController', ['$scope', '$routeParams', // Client settings and state $scope.clientProperties = new ClientProperties(); + // Initialize clipboard data to an empty string + $scope.clipboardData = ""; + // Hide menu by default $scope.menuShown = false; @@ -158,13 +161,17 @@ angular.module('home').controller('clientController', ['$scope', '$routeParams', !_.isEmpty(_.pick(CTRL_KEYS, currentKeysPressedKeys)) ) { + // Don't send this key event through to the client + event.preventDefault(); + + // Reset the keys pressed + keysCurrentlyPressed = {}; + keyboard.reset(); + // Toggle the menu $scope.safeApply(function() { $scope.menuShown = !$scope.menuShown; }); - - // Reset the keys pressed - keysCurrentlyPressed = {}; } } }); diff --git a/guacamole/src/main/webapp/app/client/directives/guacClient.js b/guacamole/src/main/webapp/app/client/directives/guacClient.js index cebe3a942..34f79e42f 100644 --- a/guacamole/src/main/webapp/app/client/directives/guacClient.js +++ b/guacamole/src/main/webapp/app/client/directives/guacClient.js @@ -436,7 +436,7 @@ 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) { - if ($scope.clientProperties.keyboardEnabled) { + if ($scope.clientProperties.keyboardEnabled && !event.defaultPrevented) { client.sendKeyEvent(1, keysym); event.preventDefault(); } @@ -444,7 +444,7 @@ angular.module('client').directive('guacClient', [function guacClient() { // Listen for broadcasted keyup events and fire the appropriate listeners $scope.$on('guacKeyup', function keyupListener(event, keysym, keyboard) { - if ($scope.clientProperties.keyboardEnabled) { + if ($scope.clientProperties.keyboardEnabled && !event.defaultPrevented) { client.sendKeyEvent(0, keysym); event.preventDefault(); }