GUAC-862: Interpret e.key as well.

This commit is contained in:
Michael Jumper
2014-09-22 13:28:19 -07:00
parent c6e3f3c686
commit 80c7d67a10

View File

@@ -492,6 +492,9 @@ Guacamole.Keyboard = function(element) {
function keysym_from_key_identifier(identifier, location) { function keysym_from_key_identifier(identifier, location) {
if (!identifier)
return null;
var typedCharacter; var typedCharacter;
// If identifier is U+xxxx, decode Unicode character // If identifier is U+xxxx, decode Unicode character
@@ -690,8 +693,9 @@ Guacamole.Keyboard = function(element) {
// Keydown event // Keydown event
if (first instanceof KeydownEvent) { if (first instanceof KeydownEvent) {
// If key is known from keyCode, use that // If key is known from keyCode or DOM3 alone, use that
var keysym = keysym_from_keycode(first.keyCode, first.location); var keysym = keysym_from_key_identifier(first.key, first.location)
|| keysym_from_keycode(first.keyCode, first.location);
if (keysym) { if (keysym) {
eventLog.shift(); eventLog.shift();
return !press_key(keysym); return !press_key(keysym);
@@ -702,8 +706,9 @@ Guacamole.Keyboard = function(element) {
// Keyup event // Keyup event
else if (first instanceof KeyupEvent) { else if (first instanceof KeyupEvent) {
// If key is known from keyCode, use that // If key is known from keyCode or DOM3 alone, use that
var keysym = keysym_from_keycode(first.keyCode, first.location); var keysym = keysym_from_key_identifier(first.key, first.location)
|| keysym_from_keycode(first.keyCode, first.location);
if (keysym) { if (keysym) {
eventLog.shift(); eventLog.shift();
release_key(keysym); release_key(keysym);