GUAC-850: Remove unnecessary case conversion of typed keys. Trust case specified by browser.

This commit is contained in:
Michael Jumper
2014-09-17 23:07:44 -07:00
parent 61e2eabdb3
commit a77188a348

View File

@@ -300,7 +300,7 @@ Guacamole.Keyboard = function(element) {
return keysyms[location] || keysyms[0]; return keysyms[location] || keysyms[0];
} }
function keysym_from_key_identifier(shifted, identifier, location) { function keysym_from_key_identifier(identifier, location) {
var typedCharacter; var typedCharacter;
@@ -319,12 +319,6 @@ Guacamole.Keyboard = function(element) {
else else
return get_keysym(keyidentifier_keysym[identifier], location); return get_keysym(keyidentifier_keysym[identifier], location);
// Convert case if shifted
if (shifted)
typedCharacter = typedCharacter.toUpperCase();
else
typedCharacter = typedCharacter.toLowerCase();
// Get codepoint // Get codepoint
var codepoint = typedCharacter.charCodeAt(0); var codepoint = typedCharacter.charCodeAt(0);
return keysym_from_charcode(codepoint); return keysym_from_charcode(codepoint);
@@ -520,8 +514,7 @@ Guacamole.Keyboard = function(element) {
// Also try to get get keysym from e.key // Also try to get get keysym from e.key
if (e.key) if (e.key)
keysym = keysym || keysym_from_key_identifier( keysym = keysym || keysym_from_key_identifier(e.key, location);
guac_keyboard.modifiers.shift, e.key, location);
// If no e.key, use e.keyIdentifier if absolutely necessary (can be buggy) // If no e.key, use e.keyIdentifier if absolutely necessary (can be buggy)
else { else {
@@ -532,8 +525,7 @@ Guacamole.Keyboard = function(element) {
|| guac_keyboard.modifiers.hyper; || guac_keyboard.modifiers.hyper;
if (keypress_unlikely && e.keyIdentifier) if (keypress_unlikely && e.keyIdentifier)
keysym = keysym || keysym_from_key_identifier( keysym = keysym || keysym_from_key_identifier(e.keyIdentifier, location);
guac_keyboard.modifiers.shift, e.keyIdentifier, location);
} }