mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 13:41:21 +00:00
GUAC-850: Remove unnecessary case conversion of typed keys. Trust case specified by browser.
This commit is contained in:
@@ -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);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user