From eead01944e8b6c52197d183df3bd3431783c1b02 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 2 Oct 2018 23:01:10 -0700 Subject: [PATCH] GUACAMOLE-232: Rely on recentKeysym for keyup only when the guessed key doesn't seem to actually be pressed. --- guacamole-common-js/src/main/webapp/modules/Keyboard.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js index 8eea4424e..d19904151 100644 --- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js +++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js @@ -387,9 +387,13 @@ Guacamole.Keyboard = function Keyboard(element) { // If key is known from keyCode or DOM3 alone, use that this.keysym = keysym_from_keycode(keyCode, location) - || recentKeysym[keyCode] || keysym_from_key_identifier(key, location); // keyCode is still more reliable for keyup when dead keys are in use + // Fall back to the most recently pressed keysym associated with the + // keyCode if the inferred key doesn't seem to actually be pressed + if (!guac_keyboard.pressed[this.keysym]) + this.keysym = recentKeysym[keyCode] || this.keysym; + // Keyup is as reliable as it will ever be this.reliable = true;