Repository: guacamole-client Updated Branches: refs/heads/staging/1.0.0 f46f52dba -> 7fcb50671
GUACAMOLE-232: Mark key as implicitly pressed only when pressed due to another, identifiable key event. Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/e3c1b6ac Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/e3c1b6ac Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/e3c1b6ac Branch: refs/heads/staging/1.0.0 Commit: e3c1b6ac98db62fa5c05c6c752d7d0843fb4894a Parents: f46f52d Author: Michael Jumper <mjum...@apache.org> Authored: Wed Oct 3 21:30:02 2018 -0700 Committer: Michael Jumper <mjum...@apache.org> Committed: Wed Oct 3 21:30:26 2018 -0700 ---------------------------------------------------------------------- .../src/main/webapp/modules/Keyboard.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/e3c1b6ac/guacamole-common-js/src/main/webapp/modules/Keyboard.js ---------------------------------------------------------------------- diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js index 3029763..ead938f 100644 --- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js +++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js @@ -964,20 +964,23 @@ Guacamole.Keyboard = function Keyboard(element) { // Press if modifier is implicitly pressed else if (!remoteState && localState) { - // Verify that modifier flag isn't set due to another version of - // the same key being held down + // Verify that modifier flag isn't already pressed or already set + // due to another version of the same key being held down for (i = 0; i < keysyms.length; i++) { if (guac_keyboard.pressed[keysyms[i]]) return; } - // Press key and mark as implicitly pressed (if not already - // explicitly pressed) + // Mark as implicitly pressed only if there is other information + // within the key event relating to a different key. Some + // platforms, such as iOS, will send essentially empty key events + // for modifier keys, using only the modifier flags to signal the + // identity of the key. var keysym = keysyms[0]; - if (!guac_keyboard.pressed(keysym)) { + if (keyEvent.keysym) implicitlyPressed[keysym] = true; - guac_keyboard.press(keysym); - } + + guac_keyboard.press(keysym); }