aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMiodec <[email protected]>2024-11-19 17:49:48 +0100
committerMiodec <[email protected]>2024-11-19 17:50:03 +0100
commita3e3de47f5db1b3f562680d8f9e7c440ad932fdf (patch)
treea9948575842c0be436d15505358efe866fa4dd4e
parentaba935448f5084e7436fd54c392851a3e04d3a43 (diff)
downloadmonkeytype-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.ts2
-rw-r--r--frontend/src/ts/controllers/input-controller.ts1
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;
}