diff options
author | Miodec <[email protected]> | 2024-11-19 17:49:48 +0100 |
---|---|---|
committer | Miodec <[email protected]> | 2024-11-19 17:50:03 +0100 |
commit | a3e3de47f5db1b3f562680d8f9e7c440ad932fdf (patch) | |
tree | a9948575842c0be436d15505358efe866fa4dd4e | |
parent | aba935448f5084e7436fd54c392851a3e04d3a43 (diff) | |
download | monkeytype-a3e3de47f5db1b3f562680d8f9e7c440ad932fdf.tar.gz monkeytype-a3e3de47f5db1b3f562680d8f9e7c440ad932fdf.zip |
fix: home and end keys not ignored during test, causing desync
closes #6053
-rw-r--r-- | frontend/src/ts/constants/ignored-keys.ts | 2 | ||||
-rw-r--r-- | frontend/src/ts/controllers/input-controller.ts | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/frontend/src/ts/constants/ignored-keys.ts b/frontend/src/ts/constants/ignored-keys.ts index 40680705c..8ee3e9bbc 100644 --- a/frontend/src/ts/constants/ignored-keys.ts +++ b/frontend/src/ts/constants/ignored-keys.ts @@ -5,4 +5,6 @@ export const IgnoredKeys = [ "AudioVolumeUp", "AudioVolumeDown", "AudioVolumeMute", + "Home", + "End", ]; diff --git a/frontend/src/ts/controllers/input-controller.ts b/frontend/src/ts/controllers/input-controller.ts index 5acdae853..d28b4281a 100644 --- a/frontend/src/ts/controllers/input-controller.ts +++ b/frontend/src/ts/controllers/input-controller.ts @@ -904,6 +904,7 @@ $(document).on("keydown", async (event) => { console.debug( `Key ${event.key} is on the list of ignored keys. Stopping keydown event.` ); + event.preventDefault(); return; } |