1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-04 07:52:46 +08:00

Added ctrl+enter to queue prompt

This commit is contained in:
pythongosssss
2023-03-14 20:29:18 +00:00
parent ee46bef03a
commit 255ff2d6dd

View File

@@ -398,6 +398,15 @@ class ComfyApp {
api.init();
}
#addKeyboardHandler() {
window.addEventListener("keydown", (e) => {
// Queue prompt using ctrl or command + enter
if ((e.ctrlKey || e.metaKey) && (e.key === "Enter" || e.keyCode === 13 || e.keyCode === 10)) {
this.queuePrompt(0);
}
});
}
/**
* Loads all extensions from the API into the window
*/
@@ -464,6 +473,7 @@ class ComfyApp {
this.#addApiUpdateHandlers();
this.#addDropHandler();
this.#addPasteHandler();
this.#addKeyboardHandler();
await this.#invokeExtensionsAsync("setup");
}