You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by mj...@apache.org on 2018/01/15 00:55:35 UTC
[01/10] guacamole-client git commit: GUACAMOLE-113: Send through
Ctrl-Alt-Delete when hotkey Ctrl-Alt-End is pressed.
Repository: guacamole-client
Updated Branches:
refs/heads/master 656328149 -> b5361a588
GUACAMOLE-113: Send through Ctrl-Alt-Delete when hotkey Ctrl-Alt-End is pressed.
Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/d6e9a02c
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/d6e9a02c
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/d6e9a02c
Branch: refs/heads/master
Commit: d6e9a02c43b2cb81c77e5e63121f4d57e93a58b5
Parents: 6a747d1
Author: Nick Couchman <vn...@apache.org>
Authored: Mon Jul 17 15:41:49 2017 -0400
Committer: Nick Couchman <vn...@apache.org>
Committed: Wed Jan 3 11:36:14 2018 -0500
----------------------------------------------------------------------
.../app/client/controllers/clientController.js | 35 ++++++++++++++++----
1 file changed, 28 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/d6e9a02c/guacamole/src/main/webapp/app/client/controllers/clientController.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js
index 86f6c1a..6c80039 100644
--- a/guacamole/src/main/webapp/app/client/controllers/clientController.js
+++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js
@@ -31,6 +31,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
// Required services
var $location = $injector.get('$location');
+ var $rootScope = $injector.get('$rootScope');
var authenticationService = $injector.get('authenticationService');
var clipboardService = $injector.get('clipboardService');
var guacClientManager = $injector.get('guacClientManager');
@@ -64,7 +65,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
*/
var MENU_DRAG_VERTICAL_TOLERANCE = 10;
- /*
+ /**
* In order to open the guacamole menu, we need to hit ctrl-alt-shift. There are
* several possible keysysms for each key.
*/
@@ -74,7 +75,15 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
CTRL_KEYS = {0xFFE3 : true, 0xFFE4 : true},
END_KEYS = {0xFF57 : true, 0xFFB1 : true},
MENU_KEYS = angular.extend({}, SHIFT_KEYS, ALT_KEYS, CTRL_KEYS);
- CAD_KEYS = angular.extend({}, ALT_KEYS, CTRL_KEYS, END_KEYS);
+
+ /**
+ * Keys needed to support the Ctrl-Alt-End hotkey for sending
+ * Ctrl-Alt-Delete.
+ */
+ CAD_KEYS = angular.extend({}, ALT_KEYS, CTRL_KEYS, END_KEYS);
+ var CTRL_KEY = 0xFFE3;
+ var ALT_KEY = 0xFFE9;
+ var DEL_KEY = 0xFFFF;
/**
* All client error codes handled and passed off for translation. Any error
@@ -501,14 +510,17 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
};
- // Track pressed keys, opening the Guacamole menu after Ctrl+Alt+Shift
+ /**
+ * Track pressed keys, opening the Guacamole menu after Ctrl+Alt+Shift, or
+ * send Ctrl-Alt-Delete when Ctrl-Alt-End is pressed.
+ */
$scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) {
// Record key as pressed
keysCurrentlyPressed[keysym] = true;
var currentKeysPressedKeys = Object.keys(keysCurrentlyPressed);
- /*
+ /**
* If only menu keys are pressed, and we have one keysym from each group,
* and one of the keys is being released, show the menu.
*/
@@ -534,6 +546,10 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
}
}
+ /**
+ * If only Ctrl-Alt-End is pressed, and we have a one keysym from each
+ * group, and one key is being released, send Ctrl-Alt-Delete.
+ */
if(checkCADHotkeyActive()) {
// Check that there is a key pressed for each of the required key classes
@@ -545,12 +561,17 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
// Don't send this key event through to the client
event.preventDefault();
- // Log the event
- console.log('We should trigger Ctrl-Alt-Delete here.');
-
// Reset the keys pressed
keysCurrentlyPressed = {};
keyboard.reset();
+
+ // Send the Ctrl-Alt-Delete event.
+ $rootScope.$broadcast('guacSyntheticKeydown', CTRL_KEY);
+ $rootScope.$broadcast('guacSyntheticKeydown', ALT_KEY);
+ $rootScope.$broadcast('guacSyntheticKeydown', DEL_KEY);
+ $rootScope.$broadcast('guacSyntheticKeyup', DEL_KEY);
+ $rootScope.$broadcast('guacSyntheticKeyup', ALT_KEY);
+ $rootScope.$broadcast('guacSyntheticKeyup', CTRL_KEY);
}
}
[02/10] guacamole-client git commit: GUACAMOLE-113: Capture
Ctrl-Alt-End keypress in order to do something useful with it.
Posted by mj...@apache.org.
GUACAMOLE-113: Capture Ctrl-Alt-End keypress in order to do something useful with it.
Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/6a747d11
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/6a747d11
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/6a747d11
Branch: refs/heads/master
Commit: 6a747d116f84fe55a4b1c6c4496b74879e54bde6
Parents: d73a0ec
Author: Nick Couchman <vn...@apache.org>
Authored: Thu Mar 23 11:56:27 2017 -0400
Committer: Nick Couchman <vn...@apache.org>
Committed: Wed Jan 3 11:36:14 2018 -0500
----------------------------------------------------------------------
.../app/client/controllers/clientController.js | 34 +++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/6a747d11/guacamole/src/main/webapp/app/client/controllers/clientController.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js
index 88cfaa0..86f6c1a 100644
--- a/guacamole/src/main/webapp/app/client/controllers/clientController.js
+++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js
@@ -72,7 +72,9 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
ALT_KEYS = {0xFFE9 : true, 0xFFEA : true, 0xFE03 : true,
0xFFE7 : true, 0xFFE8 : true},
CTRL_KEYS = {0xFFE3 : true, 0xFFE4 : true},
+ END_KEYS = {0xFF57 : true, 0xFFB1 : true},
MENU_KEYS = angular.extend({}, SHIFT_KEYS, ALT_KEYS, CTRL_KEYS);
+ CAD_KEYS = angular.extend({}, ALT_KEYS, CTRL_KEYS, END_KEYS);
/**
* All client error codes handled and passed off for translation. Any error
@@ -288,6 +290,16 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
return true;
}
+ function checkCADHotkeyActive() {
+ for(var keysym in keysCurrentlyPressed) {
+ if(!CAD_KEYS[keysym]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
// Hide menu when the user swipes from the right
$scope.menuDrag = function menuDrag(inProgress, startX, startY, currentX, currentY, deltaX, deltaY) {
@@ -495,12 +507,12 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
// Record key as pressed
keysCurrentlyPressed[keysym] = true;
+ var currentKeysPressedKeys = Object.keys(keysCurrentlyPressed);
/*
* If only menu keys are pressed, and we have one keysym from each group,
* and one of the keys is being released, show the menu.
*/
if(checkMenuModeActive()) {
- var currentKeysPressedKeys = Object.keys(keysCurrentlyPressed);
// Check that there is a key pressed for each of the required key classes
if(!_.isEmpty(_.pick(SHIFT_KEYS, currentKeysPressedKeys)) &&
@@ -522,6 +534,26 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
}
}
+ if(checkCADHotkeyActive()) {
+
+ // Check that there is a key pressed for each of the required key classes
+ if(!_.isEmpty(_.pick(ALT_KEYS, currentKeysPressedKeys)) &&
+ !_.isEmpty(_.pick(CTRL_KEYS, currentKeysPressedKeys)) &&
+ !_.isEmpty(_.pick(END_KEYS, currentKeysPressedKeys))
+ ) {
+
+ // Don't send this key event through to the client
+ event.preventDefault();
+
+ // Log the event
+ console.log('We should trigger Ctrl-Alt-Delete here.');
+
+ // Reset the keys pressed
+ keysCurrentlyPressed = {};
+ keyboard.reset();
+ }
+ }
+
});
// Update pressed keys as they are released, synchronizing the clipboard
[10/10] guacamole-client git commit: GUACAMOLE-113: Merge support for
Ctrl-Alt-End shortcut for Ctrl-Alt-Del.
Posted by mj...@apache.org.
GUACAMOLE-113: Merge support for Ctrl-Alt-End shortcut for Ctrl-Alt-Del.
Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/b5361a58
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/b5361a58
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/b5361a58
Branch: refs/heads/master
Commit: b5361a5889b508c17a94922e395843e1c52584ac
Parents: 6563281 cd4fcab
Author: Michael Jumper <mj...@apache.org>
Authored: Sun Jan 14 16:54:24 2018 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Sun Jan 14 16:54:24 2018 -0800
----------------------------------------------------------------------
.../app/client/controllers/clientController.js | 79 ++++++++++++++++----
1 file changed, 66 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
[03/10] guacamole-client git commit: GUACAMOLE-113: Refactor the
hotkey to avoid sending unnecessary keystrokes.
Posted by mj...@apache.org.
GUACAMOLE-113: Refactor the hotkey to avoid sending unnecessary keystrokes.
Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/ae9248fb
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/ae9248fb
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/ae9248fb
Branch: refs/heads/master
Commit: ae9248fbe3999f4a1ea1d0535ae98effdc89f7ca
Parents: d6e9a02
Author: Nick Couchman <vn...@apache.org>
Authored: Wed Jan 3 14:01:18 2018 -0500
Committer: Nick Couchman <vn...@apache.org>
Committed: Wed Jan 3 14:01:18 2018 -0500
----------------------------------------------------------------------
.../app/client/controllers/clientController.js | 60 ++++++++------------
1 file changed, 23 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/ae9248fb/guacamole/src/main/webapp/app/client/controllers/clientController.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js
index 6c80039..d66525f 100644
--- a/guacamole/src/main/webapp/app/client/controllers/clientController.js
+++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js
@@ -299,16 +299,6 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
return true;
}
- function checkCADHotkeyActive() {
- for(var keysym in keysCurrentlyPressed) {
- if(!CAD_KEYS[keysym]) {
- return false;
- }
- }
-
- return true;
- }
-
// Hide menu when the user swipes from the right
$scope.menuDrag = function menuDrag(inProgress, startX, startY, currentX, currentY, deltaX, deltaY) {
@@ -524,12 +514,12 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
* If only menu keys are pressed, and we have one keysym from each group,
* and one of the keys is being released, show the menu.
*/
- if(checkMenuModeActive()) {
+ if (checkMenuModeActive()) {
// Check that there is a key pressed for each of the required key classes
- if(!_.isEmpty(_.pick(SHIFT_KEYS, currentKeysPressedKeys)) &&
- !_.isEmpty(_.pick(ALT_KEYS, currentKeysPressedKeys)) &&
- !_.isEmpty(_.pick(CTRL_KEYS, currentKeysPressedKeys))
+ if (!_.isEmpty(_.pick(SHIFT_KEYS, currentKeysPressedKeys)) &&
+ !_.isEmpty(_.pick(ALT_KEYS, currentKeysPressedKeys)) &&
+ !_.isEmpty(_.pick(CTRL_KEYS, currentKeysPressedKeys))
) {
// Don't send this key event through to the client
@@ -550,29 +540,13 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
* If only Ctrl-Alt-End is pressed, and we have a one keysym from each
* group, and one key is being released, send Ctrl-Alt-Delete.
*/
- if(checkCADHotkeyActive()) {
-
- // Check that there is a key pressed for each of the required key classes
- if(!_.isEmpty(_.pick(ALT_KEYS, currentKeysPressedKeys)) &&
- !_.isEmpty(_.pick(CTRL_KEYS, currentKeysPressedKeys)) &&
- !_.isEmpty(_.pick(END_KEYS, currentKeysPressedKeys))
- ) {
-
- // Don't send this key event through to the client
- event.preventDefault();
-
- // Reset the keys pressed
- keysCurrentlyPressed = {};
- keyboard.reset();
-
- // Send the Ctrl-Alt-Delete event.
- $rootScope.$broadcast('guacSyntheticKeydown', CTRL_KEY);
- $rootScope.$broadcast('guacSyntheticKeydown', ALT_KEY);
- $rootScope.$broadcast('guacSyntheticKeydown', DEL_KEY);
- $rootScope.$broadcast('guacSyntheticKeyup', DEL_KEY);
- $rootScope.$broadcast('guacSyntheticKeyup', ALT_KEY);
- $rootScope.$broadcast('guacSyntheticKeyup', CTRL_KEY);
- }
+ if (END_KEYS[keysym] &&
+ !_.isEmpty(_.pick(ALT_KEYS, currentKeysPressedKeys)) &&
+ !_.isEmpty(_.pick(CTRL_KEYS, currentKeysPressedKeys))
+ ) {
+ event.preventDefault();
+ delete keysCurrentlyPressed[keysym];
+ $rootScope.$broadcast('guacSyntheticKeydown', DEL_KEY);
}
});
@@ -581,12 +555,24 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
// with any data that appears to have come from those key presses
$scope.$on('guacKeyup', function keyupListener(event, keysym, keyboard) {
+ var currentKeysPressedKeys = Object.keys(keysCurrentlyPressed);
+
// Sync local clipboard with any clipboard data received while this
// key was pressed (if any) as long as the menu is not open
var clipboardData = clipboardDataFromKey[keysym];
if (clipboardData && !$scope.menu.shown)
clipboardService.setLocalClipboard(clipboardData);
+ if (END_KEYS[keysym] &&
+ !_.isEmpty(_.pick(ALT_KEYS, currentKeysPressedKeys)) &&
+ !_.isEmpty(_.pick(CTRL_KEYS, currentKeysPressedKeys))
+ ) {
+
+ event.preventDefault();
+ $rootScope.$broadcast('guacSyntheticKeyup', DEL_KEY);
+
+ }
+
// Mark key as released
delete clipboardDataFromKey[keysym];
delete keysCurrentlyPressed[keysym];
[09/10] guacamole-client git commit: GUACAMOLE-113: Style and comment
cleanup.
Posted by mj...@apache.org.
GUACAMOLE-113: Style and comment cleanup.
Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/cd4fcabe
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/cd4fcabe
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/cd4fcabe
Branch: refs/heads/master
Commit: cd4fcabe3a71db28e6a5804f7ee399295414e3ae
Parents: f358cf2
Author: Nick Couchman <vn...@apache.org>
Authored: Sun Jan 14 19:48:41 2018 -0500
Committer: Nick Couchman <vn...@apache.org>
Committed: Sun Jan 14 19:48:41 2018 -0500
----------------------------------------------------------------------
.../app/client/controllers/clientController.js | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/cd4fcabe/guacamole/src/main/webapp/app/client/controllers/clientController.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js
index bf692bc..a21c0a2 100644
--- a/guacamole/src/main/webapp/app/client/controllers/clientController.js
+++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js
@@ -551,10 +551,19 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
!_.isEmpty(_.pick(ALT_KEYS, currentKeysPressedKeys)) &&
!_.isEmpty(_.pick(CTRL_KEYS, currentKeysPressedKeys))
) {
- event.preventDefault();
- delete keysCurrentlyPressed[keysym];
- substituteKeysPressed[keysym] = DEL_KEY;
- $scope.$broadcast('guacSyntheticKeydown', DEL_KEY);
+
+ // Don't send this event through to the client.
+ event.preventDefault();
+
+ // Remove the original key press
+ delete keysCurrentlyPressed[keysym];
+
+ // Record the substituted key press so that it can be
+ // properly dealt with later.
+ substituteKeysPressed[keysym] = DEL_KEY;
+
+ // Send through the delete key.
+ $scope.$broadcast('guacSyntheticKeydown', DEL_KEY);
}
});
[04/10] guacamole-client git commit: GUACAMOLE-113: Remove
unnecessary declerations and update comments.
Posted by mj...@apache.org.
GUACAMOLE-113: Remove unnecessary declerations and update comments.
Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/50c196d7
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/50c196d7
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/50c196d7
Branch: refs/heads/master
Commit: 50c196d703dc8fdace4bf18eec87d465e70d4010
Parents: ae9248f
Author: Nick Couchman <vn...@apache.org>
Authored: Wed Jan 3 14:05:07 2018 -0500
Committer: Nick Couchman <vn...@apache.org>
Committed: Wed Jan 3 14:05:07 2018 -0500
----------------------------------------------------------------------
.../main/webapp/app/client/controllers/clientController.js | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/50c196d7/guacamole/src/main/webapp/app/client/controllers/clientController.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js
index d66525f..e952747 100644
--- a/guacamole/src/main/webapp/app/client/controllers/clientController.js
+++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js
@@ -77,12 +77,9 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
MENU_KEYS = angular.extend({}, SHIFT_KEYS, ALT_KEYS, CTRL_KEYS);
/**
- * Keys needed to support the Ctrl-Alt-End hotkey for sending
- * Ctrl-Alt-Delete.
+ * Keysym for sending the DELETE key when the Ctrl-Alt-End hotkey
+ * combo is pressed.
*/
- CAD_KEYS = angular.extend({}, ALT_KEYS, CTRL_KEYS, END_KEYS);
- var CTRL_KEY = 0xFFE3;
- var ALT_KEY = 0xFFE9;
var DEL_KEY = 0xFFFF;
/**
[08/10] guacamole-client git commit: GUACAMOLE-113: Use scope instead
of rootScope.
Posted by mj...@apache.org.
GUACAMOLE-113: Use scope instead of rootScope.
Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/f358cf29
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/f358cf29
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/f358cf29
Branch: refs/heads/master
Commit: f358cf298b1567950117211606b9851a670f29b3
Parents: 9a9b570
Author: Nick Couchman <vn...@apache.org>
Authored: Sat Jan 13 23:25:27 2018 -0500
Committer: Nick Couchman <vn...@apache.org>
Committed: Sat Jan 13 23:25:27 2018 -0500
----------------------------------------------------------------------
.../main/webapp/app/client/controllers/clientController.js | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/f358cf29/guacamole/src/main/webapp/app/client/controllers/clientController.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js
index d26c873..bf692bc 100644
--- a/guacamole/src/main/webapp/app/client/controllers/clientController.js
+++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js
@@ -31,7 +31,6 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
// Required services
var $location = $injector.get('$location');
- var $rootScope = $injector.get('$rootScope');
var authenticationService = $injector.get('authenticationService');
var clipboardService = $injector.get('clipboardService');
var guacClientManager = $injector.get('guacClientManager');
@@ -79,7 +78,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
* Keysym for detecting any END key presses, for the purpose of passing through
* the Ctrl-Alt-Del sequence to a remote system.
*/
- END_KEYS = {0xFF57 : true, 0xFFB1 : true},
+ var END_KEYS = {0xFF57 : true, 0xFFB1 : true};
/**
* Keysym for sending the DELETE key when the Ctrl-Alt-End hotkey
@@ -555,7 +554,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
event.preventDefault();
delete keysCurrentlyPressed[keysym];
substituteKeysPressed[keysym] = DEL_KEY;
- $rootScope.$broadcast('guacSyntheticKeydown', DEL_KEY);
+ $scope.$broadcast('guacSyntheticKeydown', DEL_KEY);
}
});
@@ -574,7 +573,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
if (substituteKeysPressed[keysym]) {
event.preventDefault();
delete substituteKeysPressed[keysym];
- $rootScope.$broadcast('guacSyntheticKeyup', substituteKeysPressed[keysym]);
+ $scope.$broadcast('guacSyntheticKeyup', substituteKeysPressed[keysym]);
}
// Mark key as released
[07/10] guacamole-client git commit: GUACAMOLE-113: Code clean-up -
style, comments, and unneeded variables.
Posted by mj...@apache.org.
GUACAMOLE-113: Code clean-up - style, comments, and unneeded variables.
Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/9a9b5705
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/9a9b5705
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/9a9b5705
Branch: refs/heads/master
Commit: 9a9b570543cf38a8c1b56cfe59903e2566c24ca5
Parents: 5376794
Author: Nick Couchman <vn...@apache.org>
Authored: Sat Jan 13 23:15:46 2018 -0500
Committer: Nick Couchman <vn...@apache.org>
Committed: Sat Jan 13 23:15:46 2018 -0500
----------------------------------------------------------------------
.../app/client/controllers/clientController.js | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/9a9b5705/guacamole/src/main/webapp/app/client/controllers/clientController.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js
index 04b137a..d26c873 100644
--- a/guacamole/src/main/webapp/app/client/controllers/clientController.js
+++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js
@@ -73,14 +73,21 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
ALT_KEYS = {0xFFE9 : true, 0xFFEA : true, 0xFE03 : true,
0xFFE7 : true, 0xFFE8 : true},
CTRL_KEYS = {0xFFE3 : true, 0xFFE4 : true},
- END_KEYS = {0xFF57 : true, 0xFFB1 : true},
MENU_KEYS = angular.extend({}, SHIFT_KEYS, ALT_KEYS, CTRL_KEYS);
/**
+ * Keysym for detecting any END key presses, for the purpose of passing through
+ * the Ctrl-Alt-Del sequence to a remote system.
+ */
+ END_KEYS = {0xFF57 : true, 0xFFB1 : true},
+
+ /**
* Keysym for sending the DELETE key when the Ctrl-Alt-End hotkey
* combo is pressed.
+ *
+ * @type Number
*/
- var DEL_KEY = 0xFFFF;
+ var DEL_KEY = 0xFFFF;
/**
* All client error codes handled and passed off for translation. Any error
@@ -539,8 +546,8 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
}
}
- // If only Ctrl-Alt-End is pressed, and we have a one keysym from each
- // group, and one key is being released, send Ctrl-Alt-Delete.
+ // If one of the End keys is pressed, and we have a one keysym from each
+ // of Ctrl and Alt groups, send Ctrl-Alt-Delete.
if (END_KEYS[keysym] &&
!_.isEmpty(_.pick(ALT_KEYS, currentKeysPressedKeys)) &&
!_.isEmpty(_.pick(CTRL_KEYS, currentKeysPressedKeys))
@@ -557,8 +564,6 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
// with any data that appears to have come from those key presses
$scope.$on('guacKeyup', function keyupListener(event, keysym, keyboard) {
- var currentKeysPressedKeys = Object.keys(keysCurrentlyPressed);
-
// Sync local clipboard with any clipboard data received while this
// key was pressed (if any) as long as the menu is not open
var clipboardData = clipboardDataFromKey[keysym];
[06/10] guacamole-client git commit: GUACAMOLE-113: Fix style issues
in code.
Posted by mj...@apache.org.
GUACAMOLE-113: Fix style issues in code.
Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/5376794e
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/5376794e
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/5376794e
Branch: refs/heads/master
Commit: 5376794e05d61862b8fca9114c38d10246eebcf9
Parents: 733a4d4
Author: Nick Couchman <vn...@apache.org>
Authored: Thu Jan 4 22:52:57 2018 -0500
Committer: Nick Couchman <vn...@apache.org>
Committed: Thu Jan 4 22:52:57 2018 -0500
----------------------------------------------------------------------
.../app/client/controllers/clientController.js | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/5376794e/guacamole/src/main/webapp/app/client/controllers/clientController.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js
index f38ada4..04b137a 100644
--- a/guacamole/src/main/webapp/app/client/controllers/clientController.js
+++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js
@@ -278,6 +278,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
* 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 = {};
@@ -505,20 +506,17 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
};
- /**
- * Track pressed keys, opening the Guacamole menu after Ctrl+Alt+Shift, or
- * send Ctrl-Alt-Delete when Ctrl-Alt-End is pressed.
- */
+ // Track pressed keys, opening the Guacamole menu after Ctrl+Alt+Shift, or
+ // send Ctrl-Alt-Delete when Ctrl-Alt-End is pressed.
$scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) {
// Record key as pressed
keysCurrentlyPressed[keysym] = true;
var currentKeysPressedKeys = Object.keys(keysCurrentlyPressed);
- /**
- * If only menu keys are pressed, and we have one keysym from each group,
- * and one of the keys is being released, show the menu.
- */
+
+ // If only menu keys are pressed, and we have one keysym from each group,
+ // and one of the keys is being released, show the menu.
if (checkMenuModeActive()) {
// Check that there is a key pressed for each of the required key classes
@@ -541,10 +539,8 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
}
}
- /**
- * If only Ctrl-Alt-End is pressed, and we have a one keysym from each
- * group, and one key is being released, send Ctrl-Alt-Delete.
- */
+ // If only Ctrl-Alt-End is pressed, and we have a one keysym from each
+ // group, and one key is being released, send Ctrl-Alt-Delete.
if (END_KEYS[keysym] &&
!_.isEmpty(_.pick(ALT_KEYS, currentKeysPressedKeys)) &&
!_.isEmpty(_.pick(CTRL_KEYS, currentKeysPressedKeys))
[05/10] guacamole-client git commit: GUACAMOLE-113: Add object to
clientController to keep track of substituted keys.
Posted by mj...@apache.org.
GUACAMOLE-113: Add object to clientController to keep track of substituted keys.
Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/733a4d42
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/733a4d42
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/733a4d42
Branch: refs/heads/master
Commit: 733a4d42faa3a433d65b8531da2485d5fa50acee
Parents: 50c196d
Author: Nick Couchman <vn...@apache.org>
Authored: Thu Jan 4 19:11:41 2018 -0500
Committer: Nick Couchman <vn...@apache.org>
Committed: Thu Jan 4 19:11:41 2018 -0500
----------------------------------------------------------------------
.../app/client/controllers/clientController.js | 26 +++++++++++++-------
1 file changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/733a4d42/guacamole/src/main/webapp/app/client/controllers/clientController.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js
index e952747..f38ada4 100644
--- a/guacamole/src/main/webapp/app/client/controllers/clientController.js
+++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js
@@ -275,6 +275,14 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
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
* received from the remote desktop while those keys were pressed. All keys
* not currently pressed will not have entries within this map.
@@ -543,6 +551,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
) {
event.preventDefault();
delete keysCurrentlyPressed[keysym];
+ substituteKeysPressed[keysym] = DEL_KEY;
$rootScope.$broadcast('guacSyntheticKeydown', DEL_KEY);
}
@@ -560,19 +569,18 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
if (clipboardData && !$scope.menu.shown)
clipboardService.setLocalClipboard(clipboardData);
- if (END_KEYS[keysym] &&
- !_.isEmpty(_.pick(ALT_KEYS, currentKeysPressedKeys)) &&
- !_.isEmpty(_.pick(CTRL_KEYS, currentKeysPressedKeys))
- ) {
-
+ // Deal with substitute key presses
+ if (substituteKeysPressed[keysym]) {
event.preventDefault();
- $rootScope.$broadcast('guacSyntheticKeyup', DEL_KEY);
-
+ delete substituteKeysPressed[keysym];
+ $rootScope.$broadcast('guacSyntheticKeyup', substituteKeysPressed[keysym]);
}
// Mark key as released
- delete clipboardDataFromKey[keysym];
- delete keysCurrentlyPressed[keysym];
+ else {
+ delete clipboardDataFromKey[keysym];
+ delete keysCurrentlyPressed[keysym];
+ }
});