Skip to content

Commit

Permalink
prevent alt menu for firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
light-and-ray committed Mar 15, 2024
1 parent 3e0146f commit 5ed2d70
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions extensions-builtin/canvas-zoom-and-pan/javascript/zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -966,3 +966,26 @@ onUiLoaded(async() => {
// Add integration with Inpaint Anything
// applyZoomAndPanIntegration("None", ["#ia_sam_image", "#ia_sel_mask"]);
});


onUiLoaded(function(){

Check failure on line 971 in extensions-builtin/canvas-zoom-and-pan/javascript/zoom.js

View workflow job for this annotation

GitHub Actions / eslint

Missing space before opening brace
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);
});

0 comments on commit 5ed2d70

Please sign in to comment.