GUAC-659: Do not ignore keydown if e.key is present. Pull keysym from e.key in keyup if possible.

This commit is contained in:
Michael Jumper
2014-09-19 01:03:25 -07:00
parent 7d8958ed48
commit 7b6432e2cb

View File

@@ -497,7 +497,7 @@ Guacamole.Keyboard = function(element) {
var location = e.location || e.keyLocation || 0;
// Ignore any unknown key events
if (!keynum) {
if (!keynum && !e.key) {
e.preventDefault();
return;
}
@@ -593,11 +593,18 @@ Guacamole.Keyboard = function(element) {
if (window.event) keynum = window.event.keyCode;
else if (e.which) keynum = e.which;
// Get key location
var location = e.location || e.keyLocation || 0;
// Fix modifier states
update_modifier_state(e);
// Send release event if original key known
// Derive keysym from current or past events
var keysym = keydownChar[keynum];
if (e.key)
keysym = keysym || keysym_from_key_identifier(e.key, location);
// Send release event if original key known
if (keysym !== null)
release_key(keysym);