mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUAC-862: Correct case of key based on shift if keyIdentifier in use. CapsLock cannot be tracked, but that should be OK here.
This commit is contained in:
@@ -518,7 +518,7 @@ Guacamole.Keyboard = function(element) {
|
||||
return keysyms[location] || keysyms[0];
|
||||
}
|
||||
|
||||
function keysym_from_key_identifier(identifier, location) {
|
||||
function keysym_from_key_identifier(identifier, location, shifted) {
|
||||
|
||||
if (!identifier)
|
||||
return null;
|
||||
@@ -540,6 +540,12 @@ Guacamole.Keyboard = function(element) {
|
||||
else
|
||||
return get_keysym(keyidentifier_keysym[identifier], location);
|
||||
|
||||
// Alter case if necessary
|
||||
if (shifted === true)
|
||||
typedCharacter = typedCharacter.toUpperCase();
|
||||
else if (shifted === false)
|
||||
typedCharacter = typedCharacter.toLowerCase();
|
||||
|
||||
// Get codepoint
|
||||
var codepoint = typedCharacter.charCodeAt(0);
|
||||
return keysym_from_charcode(codepoint);
|
||||
@@ -776,7 +782,7 @@ Guacamole.Keyboard = function(element) {
|
||||
|| guac_keyboard.modifiers.alt
|
||||
|| guac_keyboard.modifiers.meta
|
||||
|| guac_keyboard.modifiers.hyper)
|
||||
keysym = keysym || keysym_from_key_identifier(first.keyIdentifier, first.location);
|
||||
keysym = keysym || keysym_from_key_identifier(first.keyIdentifier, first.location, guac_keyboard.modifiers.shift);
|
||||
|
||||
if (keysym) {
|
||||
recentKeysym[first.keyCode] = keysym;
|
||||
|
Reference in New Issue
Block a user