From 26ddb06c8b0354d0540dfd3b54eb6ac2de43ea71 Mon Sep 17 00:00:00 2001 From: Jim Ramsay Date: Mon, 4 Jan 2010 22:14:21 +0800 Subject: ESC clears the keyQueue This allows a user to abort part-way through a multi-character command. --- background_page.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'background_page.html') diff --git a/background_page.html b/background_page.html index 26941cc8..f1bf450a 100644 --- a/background_page.html +++ b/background_page.html @@ -314,9 +314,15 @@ } function handleKeyDown(key, port) { - console.log("checking keyQueue: [", keyQueue + key, "]"); - keyQueue = checkKeyQueue(keyQueue + key, port.tab.id); - console.log("new KeyQueue: " + keyQueue); + if (key == "") { + console.log("clearing keyQueue"); + keyQueue = "" + } + else { + console.log("checking keyQueue: [", keyQueue + key, "]"); + keyQueue = checkKeyQueue(keyQueue + key, port.tab.id); + console.log("new KeyQueue: " + keyQueue); + } } function checkKeyQueue(keysToCheck, tabId) { -- cgit v1.2.3