mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-01 12:25:06 +08:00
prevent alt menu for firefox
This commit is contained in:
parent
3e0146f9bd
commit
6f51e05553
@ -966,3 +966,26 @@ onUiLoaded(async() => {
|
|||||||
// Add integration with Inpaint Anything
|
// Add integration with Inpaint Anything
|
||||||
// applyZoomAndPanIntegration("None", ["#ia_sam_image", "#ia_sel_mask"]);
|
// applyZoomAndPanIntegration("None", ["#ia_sam_image", "#ia_sel_mask"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
onUiLoaded(function() {
|
||||||
|
let isAltPressed = false;
|
||||||
|
|
||||||
|
function handleAltKeyDown(e) {
|
||||||
|
if (e.code === "AltLeft" || e.code === "AltRight") {
|
||||||
|
isAltPressed = true;
|
||||||
|
} else {
|
||||||
|
isAltPressed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleAltKeyUp(e) {
|
||||||
|
if (isAltPressed) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
isAltPressed = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener("keydown", handleAltKeyDown);
|
||||||
|
document.addEventListener("keyup", handleAltKeyUp);
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user