diff --git a/guacamole-common-js/src/main/resources/keyboard.js b/guacamole-common-js/src/main/resources/keyboard.js index a059847ee..474c42be6 100644 --- a/guacamole-common-js/src/main/resources/keyboard.js +++ b/guacamole-common-js/src/main/resources/keyboard.js @@ -357,6 +357,7 @@ Guacamole.Keyboard = function(element) { } + var expect_keypress = true; var keydown_code = null; var deferred_keypress = null; @@ -432,7 +433,7 @@ Guacamole.Keyboard = function(element) { return; } - var expect_keypress = true; + expect_keypress = true; // Ctrl/Alt/Shift if (keynum == 16) guac_keyboard.modifiers.shift = true; @@ -490,6 +491,10 @@ Guacamole.Keyboard = function(element) { e.preventDefault(); + // Do not handle if we weren't expecting this event (will have already + // been handled by keydown) + if (!expect_keypress) return; + var keynum; if (window.event) keynum = window.event.keyCode; else if (e.which) keynum = e.which;