From 318f3456ec3656f9f3ded3d2c6a1dc5116618f58 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 7 Nov 2014 14:42:21 -0800 Subject: [PATCH] GUAC-884: Clear event queue when keyboard is reset. Ensure no combination of key events can result in a permanently blocked queue. --- .../src/main/webapp/modules/Keyboard.js | 38 ++++--------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js index fb8e20aee..663c28a68 100644 --- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js +++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js @@ -752,6 +752,9 @@ Guacamole.Keyboard = function(element) { for (var keysym in guac_keyboard.pressed) guac_keyboard.release(parseInt(keysym)); + // Clear event log + eventLog = []; + }; /** @@ -828,35 +831,6 @@ Guacamole.Keyboard = function(element) { } - /** - * Searches the event log for a keyup event corresponding to the given - * keydown event, returning its index within the log. - * - * @param {KeydownEvent} keydown The keydown event whose corresponding keyup - * event we are to search for. - * @returns {Number} The index of the first keyup event in the event log - * matching the given keydown event, or -1 if no such - * event exists. - */ - function indexof_keyup(keydown) { - - var i; - - // Search event log for keyup events having the given keysym - for (i=0; i