From 1aa404d670a5a6a96de44559656e0d5cb1107c77 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 09:08:15 -0700 Subject: [PATCH] refactor: use keybinding manager for Escape (settings) and Enter (chat) keys - Replace hardcoded SDL_SCANCODE_ESCAPE with TOGGLE_SETTINGS keybinding - Replace hardcoded SDL_SCANCODE_RETURN with TOGGLE_CHAT keybinding - Allows customization of these keys through Settings UI --- src/ui/game_screen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 8bd9968e..168883fc 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -1452,7 +1452,7 @@ void GameScreen::processTargetInput(game::GameHandler& gameHandler) { gameHandler.tabTarget(movement.x, movement.y, movement.z); } - if (input.isKeyJustPressed(SDL_SCANCODE_ESCAPE)) { + if (KeybindingManager::getInstance().isActionPressed(KeybindingManager::Action::TOGGLE_SETTINGS, true)) { if (showSettingsWindow) { // Close settings window if open showSettingsWindow = false; @@ -1514,7 +1514,7 @@ void GameScreen::processTargetInput(game::GameHandler& gameHandler) { } // Enter key: focus chat input (empty) — always works unless already typing - if (!chatInputActive && input.isKeyJustPressed(SDL_SCANCODE_RETURN)) { + if (!chatInputActive && KeybindingManager::getInstance().isActionPressed(KeybindingManager::Action::TOGGLE_CHAT, true)) { refocusChatInput = true; }