From 9ef5d14a015647b7a358b5b5121392604469543a Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 22 Sep 2014 16:38:59 -0700 Subject: [PATCH] GUAC-862: Use keyIdentifier if it looks like it's necessary. --- .../src/main/webapp/modules/Keyboard.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js index 3a534fc6e..9189285a6 100644 --- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js +++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js @@ -768,6 +768,16 @@ Guacamole.Keyboard = function(element) { // If key is known from keyCode or DOM3 alone, use that keysym = keysym_from_key_identifier(first.key, first.location) || keysym_from_keycode(first.keyCode, first.location); + + // We must use the (potentially buggy) keyIdentifier immediately if + // keypress will likely not fire, as we need to make a best effort + // to prevent default if requested + if (guac_keyboard.modifiers.ctrl + || guac_keyboard.modifiers.alt + || guac_keyboard.modifiers.meta + || guac_keyboard.modifiers.hyper) + keysym = keysym || keysym_from_key_identifier(first.keyIdentifier, first.location); + if (keysym) { recentKeysym[first.keyCode] = keysym; first.defaultPrevented = !press_key(keysym);