fix: Certain shortcuts not being captured by ImHex Web

This commit is contained in:
WerWolv
2024-12-25 12:36:06 +01:00
parent 9b12232e9f
commit 6ead8d8b49
2 changed files with 20 additions and 12 deletions

View File

@@ -261,4 +261,8 @@ function js_resizeCanvas() {
canvas.left = document.documentElement.clientLeft;
canvas.width = Math.min(document.documentElement.clientWidth, window.innerWidth || 0);
canvas.height = Math.min(document.documentElement.clientHeight, window.innerHeight || 0);
}
}
// Prevent default browser shortcuts from preventing ImHex ones to work
document.addEventListener('keydown', e => { e.preventDefault(); })
document.addEventListener('keyup', e => { e.preventDefault(); })