GUACAMOLE-232: Rely on recentKeysym for keyup only when the guessed key doesn't seem to actually be pressed.

This commit is contained in:
Michael Jumper
2018-10-02 23:01:10 -07:00
parent 2ec7e48ca9
commit eead01944e

View File

@@ -387,9 +387,13 @@ Guacamole.Keyboard = function Keyboard(element) {
// If key is known from keyCode or DOM3 alone, use that // If key is known from keyCode or DOM3 alone, use that
this.keysym = keysym_from_keycode(keyCode, location) 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 || 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 // Keyup is as reliable as it will ever be
this.reliable = true; this.reliable = true;