mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-02 15:53:51 +00:00
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:
parent
f3415c2aff
commit
1aa404d670
1 changed files with 2 additions and 2 deletions
|
|
@ -1452,7 +1452,7 @@ void GameScreen::processTargetInput(game::GameHandler& gameHandler) {
|
||||||
gameHandler.tabTarget(movement.x, movement.y, movement.z);
|
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) {
|
if (showSettingsWindow) {
|
||||||
// Close settings window if open
|
// Close settings window if open
|
||||||
showSettingsWindow = false;
|
showSettingsWindow = false;
|
||||||
|
|
@ -1514,7 +1514,7 @@ void GameScreen::processTargetInput(game::GameHandler& gameHandler) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enter key: focus chat input (empty) — always works unless already typing
|
// 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;
|
refocusChatInput = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue