From 9e93af465f38641a4ac61b7e3552a91e457a48c2 Mon Sep 17 00:00:00 2001 From: Md Moushuf Alam <149342172+MoushufAlam@users.noreply.github.com> Date: Thu, 18 Dec 2025 16:13:47 +0530 Subject: [PATCH] refactor: replace jQuery with DOM utils for alt and shift key trackers (@MoushufAlam) (#7266) ### Description Replaces jQuery usage with DOM utils for alt and shift key trackers. Scope intentionally kept small per contributing guidelines. ### Checks - [x] Adding/modifying Typescript code? - [x] I have used `qs`, `qsa` or `qsr` instead of JQuery selectors. - [x] Check if any open issues are related to this PR; if so, be sure to tag them below. - [x] Make sure the PR title follows the Conventional Commits standard. (https://www.conventionalcommits.org for more info) - [x] Make sure to include your GitHub username prefixed with @ inside parentheses at the end of the PR title. Related to #7186 --- frontend/src/ts/test/alt-tracker.ts | 4 ++-- frontend/src/ts/test/shift-tracker.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/ts/test/alt-tracker.ts b/frontend/src/ts/test/alt-tracker.ts index edf80e459..fa1393392 100644 --- a/frontend/src/ts/test/alt-tracker.ts +++ b/frontend/src/ts/test/alt-tracker.ts @@ -1,7 +1,7 @@ export let leftState = false; export let rightState = false; -$(document).on("keydown", (e) => { +document.addEventListener("keydown", (e: KeyboardEvent) => { if (e.code === "AltLeft") { leftState = true; } else if (e.code === "AltRight") { @@ -9,7 +9,7 @@ $(document).on("keydown", (e) => { } }); -$(document).on("keyup", (e) => { +document.addEventListener("keyup", (e: KeyboardEvent) => { if (e.code === "AltLeft") { leftState = false; } else if (e.code === "AltRight") { diff --git a/frontend/src/ts/test/shift-tracker.ts b/frontend/src/ts/test/shift-tracker.ts index d60dad90a..90a7feea2 100644 --- a/frontend/src/ts/test/shift-tracker.ts +++ b/frontend/src/ts/test/shift-tracker.ts @@ -4,7 +4,7 @@ import * as KeyConverter from "../utils/key-converter"; export let leftState = false; export let rightState = false; -$(document).on("keydown", (e) => { +document.addEventListener("keydown", (e: KeyboardEvent) => { if (e.code === "ShiftLeft") { leftState = true; rightState = false; @@ -14,7 +14,7 @@ $(document).on("keydown", (e) => { } }); -$(document).on("keyup", (e) => { +document.addEventListener("keyup", (e: KeyboardEvent) => { if (e.code === "ShiftLeft" || e.code === "ShiftRight") { leftState = false; rightState = false;