adds remaining keybinds

This commit is contained in:
EllangoK 2023-04-13 01:05:46 -04:00
parent 532a3e1e9d
commit 7b40693287
2 changed files with 10 additions and 2 deletions

View File

@ -12,14 +12,19 @@ app.registerExtension({
}
const keyToButtonIdMap = {
"Enter": "queue-button",
"f": "queue-front-button",
"q": "view-queue-button",
"h": "view-history-button",
"s": "save-button",
"l": "load-button",
"r": "refresh-button",
"c": "clear-button",
"d": "load-default-button"
"d": "load-default-button",
};
const buttonId = keyToButtonIdMap[event.key];
console.log(event.key, buttonId);
if (buttonId) {
const button = document.querySelector(`#${buttonId}`);
button.dispatchEvent(new Event("click"));

View File

@ -448,6 +448,7 @@ export class ComfyUI {
$el("button.comfy-settings-btn", { textContent: "⚙️", onclick: () => this.settings.show() }),
]),
$el("button.comfy-queue-btn", {
id: "queue-button",
textContent: "Queue Prompt",
onclick: () => app.queuePrompt(0, this.batchCount),
}),
@ -496,9 +497,10 @@ export class ComfyUI {
]),
]),
$el("div.comfy-menu-btns", [
$el("button", { textContent: "Queue Front", onclick: () => app.queuePrompt(-1, this.batchCount) }),
$el("button", { id: "queue-front-button", textContent: "Queue Front", onclick: () => app.queuePrompt(-1, this.batchCount) }),
$el("button", {
$: (b) => (this.queue.button = b),
id: "view-queue-button",
textContent: "View Queue",
onclick: () => {
this.history.hide();
@ -507,6 +509,7 @@ export class ComfyUI {
}),
$el("button", {
$: (b) => (this.history.button = b),
id: "view-history-button",
textContent: "View History",
onclick: () => {
this.queue.hide();