Merge pull request #47 from AkiChase/46-right-click-and-hold-functionality

fix(hotkey): contextmenu
This commit is contained in:
如初 2024-05-23 21:08:54 +08:00 committed by GitHub
commit 0bb511a6c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -834,6 +834,9 @@ function addSightShortcuts(
// create box element // create box element
maskElement.style.cursor = "none"; maskElement.style.cursor = "none";
const mouseRangeBoxElement = createMouseRangeBox(); const mouseRangeBoxElement = createMouseRangeBox();
mouseRangeBoxElement.addEventListener("contextmenu", (e) =>
e.preventDefault()
);
mouseRangeBoxElement.addEventListener("mouseleave", moveLeaveHandler); mouseRangeBoxElement.addEventListener("mouseleave", moveLeaveHandler);
document.body.appendChild(mouseRangeBoxElement); document.body.appendChild(mouseRangeBoxElement);