mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-08 06:01:22 +00:00
GUACAMOLE-113: Add object to clientController to keep track of substituted keys.
This commit is contained in:
@@ -274,6 +274,14 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
|||||||
*/
|
*/
|
||||||
var keysCurrentlyPressed = {};
|
var keysCurrentlyPressed = {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map of all substituted key presses. If one key is pressed in place of another
|
||||||
|
* the value of the substituted key is stored in an object with the keysym of
|
||||||
|
* the original key.
|
||||||
|
* @type Object.<Number, Number>
|
||||||
|
*/
|
||||||
|
var substituteKeysPressed = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map of all currently pressed keys (by keysym) to the clipboard contents
|
* Map of all currently pressed keys (by keysym) to the clipboard contents
|
||||||
* received from the remote desktop while those keys were pressed. All keys
|
* received from the remote desktop while those keys were pressed. All keys
|
||||||
@@ -543,6 +551,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
|||||||
) {
|
) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
delete keysCurrentlyPressed[keysym];
|
delete keysCurrentlyPressed[keysym];
|
||||||
|
substituteKeysPressed[keysym] = DEL_KEY;
|
||||||
$rootScope.$broadcast('guacSyntheticKeydown', DEL_KEY);
|
$rootScope.$broadcast('guacSyntheticKeydown', DEL_KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -560,19 +569,18 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
|||||||
if (clipboardData && !$scope.menu.shown)
|
if (clipboardData && !$scope.menu.shown)
|
||||||
clipboardService.setLocalClipboard(clipboardData);
|
clipboardService.setLocalClipboard(clipboardData);
|
||||||
|
|
||||||
if (END_KEYS[keysym] &&
|
// Deal with substitute key presses
|
||||||
!_.isEmpty(_.pick(ALT_KEYS, currentKeysPressedKeys)) &&
|
if (substituteKeysPressed[keysym]) {
|
||||||
!_.isEmpty(_.pick(CTRL_KEYS, currentKeysPressedKeys))
|
|
||||||
) {
|
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
$rootScope.$broadcast('guacSyntheticKeyup', DEL_KEY);
|
delete substituteKeysPressed[keysym];
|
||||||
|
$rootScope.$broadcast('guacSyntheticKeyup', substituteKeysPressed[keysym]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mark key as released
|
// Mark key as released
|
||||||
delete clipboardDataFromKey[keysym];
|
else {
|
||||||
delete keysCurrentlyPressed[keysym];
|
delete clipboardDataFromKey[keysym];
|
||||||
|
delete keysCurrentlyPressed[keysym];
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user