mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUAC-875: Handle possibly-null key identifier.
This commit is contained in:
@@ -640,10 +640,15 @@ Guacamole.Keyboard = function(element) {
|
||||
* @param {String} keyIdentifier The legacy keyIdentifier from a
|
||||
* browser keydown/keyup event.
|
||||
* @returns {Boolean} true if the keyIdentifier looks sane, false if
|
||||
* the keyIdentifier appears incorrectly derived.
|
||||
* the keyIdentifier appears incorrectly derived or
|
||||
* is missing entirely.
|
||||
*/
|
||||
function key_identifier_sane(keyCode, keyIdentifier) {
|
||||
|
||||
// Missing identifier is not sane
|
||||
if (!keyIdentifier)
|
||||
return false;
|
||||
|
||||
// Assume non-Unicode keyIdentifier values are sane
|
||||
var unicodePrefixLocation = keyIdentifier.indexOf("U+");
|
||||
if (unicodePrefixLocation === -1)
|
||||
|
Reference in New Issue
Block a user