From 8115b755a27da74ac106d2d2f3b0f7f7f6e24a52 Mon Sep 17 00:00:00 2001 From: TKTK123456 <103334266+TKTK123456@users.noreply.github.com> Date: Sat, 6 Jun 2026 21:29:16 -0400 Subject: [PATCH] Fix rebinded keys (#4175) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > **Before opening a PR:** discuss new features on [Discord](https://discord.gg/K9zernJB5z) first, and file bugs or small improvements as [issues](https://github.com/openfrontio/OpenFrontIO/issues/new/choose). You must be assigned to an `approved` issue — unsolicited PRs will be auto-closed. **Add approved & assigned issue number here:** Resolves #4174 ## Description: I have fixed the rebinding of the keys for the build menu modifier and the emoji menu modifier in the settings so that they actually work. And cleaned up the code ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory ## Please put your Discord username so you can be contacted if a bug or regression is found: tktk1234567 --- src/client/HelpModal.ts | 4 ++-- src/client/InputHandler.ts | 41 ++++------------------------------ src/client/UserSettingModal.ts | 16 ++++++------- src/core/game/UserSettings.ts | 4 ++-- 4 files changed, 16 insertions(+), 49 deletions(-) diff --git a/src/client/HelpModal.ts b/src/client/HelpModal.ts index acba57635..8b5e56550 100644 --- a/src/client/HelpModal.ts +++ b/src/client/HelpModal.ts @@ -285,7 +285,7 @@ export class HelpModal extends BaseModal {
- ${this.renderKey(keybinds.modifierKey)} + ${this.renderKey(keybinds.buildMenuModifier)} +
- ${this.renderKey(keybinds.altKey)} + ${this.renderKey(keybinds.emojiMenuModifier)} +
diff --git a/src/core/game/UserSettings.ts b/src/core/game/UserSettings.ts index b11064406..4c37ce9ad 100644 --- a/src/core/game/UserSettings.ts +++ b/src/core/game/UserSettings.ts @@ -34,8 +34,8 @@ export function getDefaultKeybinds(isMac: boolean): Record { moveLeft: "KeyA", moveDown: "KeyS", moveRight: "KeyD", - modifierKey: isMac ? "MetaLeft" : "ControlLeft", - altKey: "AltLeft", + buildMenuModifier: isMac ? "MetaLeft" : "ControlLeft", + emojiMenuModifier: "AltLeft", shiftKey: "ShiftLeft", resetGfx: "KeyR", selectAllWarships: "KeyF",