Merge branch 'undoredo-fix-modifiers' of https://github.com/pythongosssss/ComfyUI

This commit is contained in:
comfyanonymous 2024-01-13 16:03:44 -05:00
commit b5ece6354d
2 changed files with 12 additions and 0 deletions

View File

@ -884,6 +884,7 @@ export class GroupNodeHandler {
const r = onDrawForeground?.apply?.(this, arguments);
if (+app.runningNodeId === this.id && this.runningInternalNodeId !== null) {
const n = groupData.nodes[this.runningInternalNodeId];
if(!n) return;
const message = `Running ${n.title || n.type} (${this.runningInternalNodeId}/${groupData.nodes.length})`;
ctx.save();
ctx.font = "12px sans-serif";

View File

@ -106,6 +106,7 @@ const bindInput = (activeEl) => {
}
};
let keyIgnored = false;
window.addEventListener(
"keydown",
(e) => {
@ -116,6 +117,9 @@ window.addEventListener(
return;
}
keyIgnored = e.key === "Control" || e.key === "Shift" || e.key === "Alt" || e.key === "Meta";
if (keyIgnored) return;
// Check if this is a ctrl+z ctrl+y
if (await undoRedo(e)) return;
@ -127,6 +131,13 @@ window.addEventListener(
true
);
window.addEventListener("keyup", (e) => {
if (keyIgnored) {
keyIgnored = false;
checkState();
}
});
// Handle clicking DOM elements (e.g. widgets)
window.addEventListener("mouseup", () => {
checkState();