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
This commit is contained in:
Kelsi 2026-03-11 09:08:15 -07:00
parent f3415c2aff
commit 1aa404d670

View file

@ -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;
}