1
0
mirror of synced 2025-01-10 21:41:53 +01:00

fix: Disable browser ctrl + S in web build

This commit is contained in:
WerWolv 2024-12-25 16:17:51 +01:00
parent 248acd5e26
commit 9e83d9e68c

View File

@ -263,6 +263,9 @@ function js_resizeCanvas() {
canvas.height = Math.min(document.documentElement.clientHeight, window.innerHeight || 0); canvas.height = Math.min(document.documentElement.clientHeight, window.innerHeight || 0);
} }
// Prevent default browser shortcuts from preventing ImHex ones to work // Prevent some default browser shortcuts from preventing ImHex ones to work
document.addEventListener('keydown', e => { e.preventDefault(); }) document.addEventListener('keydown', e => {
document.addEventListener('keyup', e => { e.preventDefault(); }) if (e.ctrlKey) {
if (e.which == 83) e.preventDefault();
}
})