mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUAC-929 Fixed bugs around keys getting stuck down when menu is hidden, and error when clipboard isn't set to any value.
This commit is contained in:
@@ -76,6 +76,9 @@ angular.module('home').controller('clientController', ['$scope', '$routeParams',
|
|||||||
// Client settings and state
|
// Client settings and state
|
||||||
$scope.clientProperties = new ClientProperties();
|
$scope.clientProperties = new ClientProperties();
|
||||||
|
|
||||||
|
// Initialize clipboard data to an empty string
|
||||||
|
$scope.clipboardData = "";
|
||||||
|
|
||||||
// Hide menu by default
|
// Hide menu by default
|
||||||
$scope.menuShown = false;
|
$scope.menuShown = false;
|
||||||
|
|
||||||
@@ -158,13 +161,17 @@ angular.module('home').controller('clientController', ['$scope', '$routeParams',
|
|||||||
!_.isEmpty(_.pick(CTRL_KEYS, currentKeysPressedKeys))
|
!_.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
|
// Toggle the menu
|
||||||
$scope.safeApply(function() {
|
$scope.safeApply(function() {
|
||||||
$scope.menuShown = !$scope.menuShown;
|
$scope.menuShown = !$scope.menuShown;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Reset the keys pressed
|
|
||||||
keysCurrentlyPressed = {};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -436,7 +436,7 @@ angular.module('client').directive('guacClient', [function guacClient() {
|
|||||||
|
|
||||||
// Listen for broadcasted keydown events and fire the appropriate listeners
|
// Listen for broadcasted keydown events and fire the appropriate listeners
|
||||||
$scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) {
|
$scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) {
|
||||||
if ($scope.clientProperties.keyboardEnabled) {
|
if ($scope.clientProperties.keyboardEnabled && !event.defaultPrevented) {
|
||||||
client.sendKeyEvent(1, keysym);
|
client.sendKeyEvent(1, keysym);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
@@ -444,7 +444,7 @@ angular.module('client').directive('guacClient', [function guacClient() {
|
|||||||
|
|
||||||
// Listen for broadcasted keyup events and fire the appropriate listeners
|
// Listen for broadcasted keyup events and fire the appropriate listeners
|
||||||
$scope.$on('guacKeyup', function keyupListener(event, keysym, keyboard) {
|
$scope.$on('guacKeyup', function keyupListener(event, keysym, keyboard) {
|
||||||
if ($scope.clientProperties.keyboardEnabled) {
|
if ($scope.clientProperties.keyboardEnabled && !event.defaultPrevented) {
|
||||||
client.sendKeyEvent(0, keysym);
|
client.sendKeyEvent(0, keysym);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user