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 <[email protected]>
Authored: Sat Jan 13 23:15:46 2018 -0500
Committer: Nick Couchman <[email protected]>
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];

Reply via email to