mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
Fixed regression with key repeat.
This commit is contained in:
@@ -277,13 +277,11 @@ Guacamole.Keyboard = function(element) {
|
|||||||
// Send key event here
|
// Send key event here
|
||||||
if (keySymSource == KEYDOWN) {
|
if (keySymSource == KEYDOWN) {
|
||||||
|
|
||||||
var returnValue = true;
|
|
||||||
|
|
||||||
if (keydownChar[keynum] != keysym) {
|
if (keydownChar[keynum] != keysym) {
|
||||||
|
|
||||||
// Send event
|
// Send event
|
||||||
keydownChar[keynum] = keysym;
|
keydownChar[keynum] = keysym;
|
||||||
returnValue = sendKeyPressed(keysym);
|
var returnValue = sendKeyPressed(keysym);
|
||||||
|
|
||||||
// Clear old key repeat, if any.
|
// Clear old key repeat, if any.
|
||||||
stopRepeat();
|
stopRepeat();
|
||||||
@@ -291,9 +289,16 @@ Guacamole.Keyboard = function(element) {
|
|||||||
// Start repeating (if not a modifier key) after a short delay
|
// Start repeating (if not a modifier key) after a short delay
|
||||||
if (keynum != 16 && keynum != 17 && keynum != 18)
|
if (keynum != 16 && keynum != 17 && keynum != 18)
|
||||||
repeatKeyTimeoutId = setTimeout(function() { startRepeat(keysym); }, 500);
|
repeatKeyTimeoutId = setTimeout(function() { startRepeat(keysym); }, 500);
|
||||||
|
|
||||||
|
// Use return code provided by handler
|
||||||
|
return returnValue;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnValue;
|
// Default to canceling event if no keypress is being sent, but
|
||||||
|
// source of events is keydown.
|
||||||
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -312,7 +317,6 @@ Guacamole.Keyboard = function(element) {
|
|||||||
if (window.event) keynum = window.event.keyCode;
|
if (window.event) keynum = window.event.keyCode;
|
||||||
else if (e.which) keynum = e.which;
|
else if (e.which) keynum = e.which;
|
||||||
|
|
||||||
var returnValue = true;
|
|
||||||
var keysym = getKeySymFromCharCode(keynum);
|
var keysym = getKeySymFromCharCode(keynum);
|
||||||
if (keysym && keydownChar[keynum] != keysym) {
|
if (keysym && keydownChar[keynum] != keysym) {
|
||||||
|
|
||||||
@@ -327,13 +331,17 @@ Guacamole.Keyboard = function(element) {
|
|||||||
stopRepeat();
|
stopRepeat();
|
||||||
|
|
||||||
// Send key event
|
// Send key event
|
||||||
returnValue = sendKeyPressed(keysym);
|
var returnValue = sendKeyPressed(keysym);
|
||||||
|
|
||||||
// Start repeating (if not a modifier key) after a short delay
|
// Start repeating (if not a modifier key) after a short delay
|
||||||
repeatKeyTimeoutId = setTimeout(function() { startRepeat(keysym); }, 500);
|
repeatKeyTimeoutId = setTimeout(function() { startRepeat(keysym); }, 500);
|
||||||
|
|
||||||
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnValue;
|
// Default to canceling event if no keypress is being sent, but
|
||||||
|
// source of events is keypress.
|
||||||
|
return false;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user