Skip to content

Commit b40e441

Browse files
committed
Use 'HUD' port to show current keyQueue
1 parent 5004ad3 commit b40e441

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

background_page.html

+7
Original file line numberDiff line numberDiff line change
@@ -314,14 +314,19 @@
314314
}
315315

316316
function handleKeyDown(key, port) {
317+
var hudport = chrome.tabs.connect(port.tab.id, { name: "HUD" });
317318
if (key == "<ESC>") {
318319
console.log("clearing keyQueue");
319320
keyQueue = ""
321+
hudport.postMessage({ message: "ESC", timeout: 10 });
320322
}
321323
else {
322324
console.log("checking keyQueue: [", keyQueue + key, "]");
323325
keyQueue = checkKeyQueue(keyQueue + key, port.tab.id);
324326
console.log("new KeyQueue: " + keyQueue);
327+
if (keyQueue != "") {
328+
hudport.postMessage({ message: keyQueue });
329+
}
325330
}
326331
}
327332

@@ -337,6 +342,8 @@
337342
if (keyToCommandRegistry[command]) {
338343
registryEntry = keyToCommandRegistry[command];
339344
console.log("command found for [", keysToCheck, "],", registryEntry);
345+
var hudport = chrome.tabs.connect(tabId, { name: "HUD" });
346+
hudport.postMessage({ message: keysToCheck, timeout: 10 });
340347

341348
if (typeof(registryEntry) == "string") {
342349
var port = chrome.tabs.connect(tabId, { name: "executePageCommand" });

0 commit comments

Comments
 (0)