mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-04-19 10:53:29 +00:00
Fix modifiers triggering key down checks
This commit is contained in:
parent
56d9496b18
commit
df49a727ff
@ -106,6 +106,7 @@ const bindInput = (activeEl) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let keyIgnored = false;
|
||||||
window.addEventListener(
|
window.addEventListener(
|
||||||
"keydown",
|
"keydown",
|
||||||
(e) => {
|
(e) => {
|
||||||
@ -116,6 +117,9 @@ window.addEventListener(
|
|||||||
return;
|
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
|
// Check if this is a ctrl+z ctrl+y
|
||||||
if (await undoRedo(e)) return;
|
if (await undoRedo(e)) return;
|
||||||
|
|
||||||
@ -127,6 +131,13 @@ window.addEventListener(
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
window.addEventListener("keyup", (e) => {
|
||||||
|
if (keyIgnored) {
|
||||||
|
keyIgnored = false;
|
||||||
|
checkState();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Handle clicking DOM elements (e.g. widgets)
|
// Handle clicking DOM elements (e.g. widgets)
|
||||||
window.addEventListener("mouseup", () => {
|
window.addEventListener("mouseup", () => {
|
||||||
checkState();
|
checkState();
|
||||||
|
Loading…
Reference in New Issue
Block a user