From 9aa0278f7e76389fcfcf12839362cb9803f1702b Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sun, 12 Sep 2021 02:13:34 +0300 Subject: [PATCH] hotkeys - check for code --- modules/ui/hotkeys.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui/hotkeys.js b/modules/ui/hotkeys.js index 3cf00060..6f76fb4f 100644 --- a/modules/ui/hotkeys.js +++ b/modules/ui/hotkeys.js @@ -4,7 +4,7 @@ document.addEventListener("keydown", handleKeydown); document.addEventListener("keyup", handleKeyup); function handleKeydown(event) { - const {key, ctrlKey, altKey} = event; + const {key, code, ctrlKey, altKey} = event; if (altKey && !ctrlKey) event.preventDefault(); // disallow alt key combinations if (ctrlKey && ["KeyS", "KeyC"].includes(code)) event.preventDefault(); // disallow CTRL + S and CTRL + C if (["F1", "F2", "F6", "F9", "Tab"].includes(key)) event.preventDefault(); // disallow default Fn and Tab