From 565c78d1419d7834d925926d70980a9c2a4fa5d9 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 14 Mar 2026 03:37:24 -0700 Subject: [PATCH] fix(input): reserve Q for strafe-left --- src/rendering/performance_hud.cpp | 2 +- src/ui/keybinding_manager.cpp | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/rendering/performance_hud.cpp b/src/rendering/performance_hud.cpp index a5a76ab2..d6119e74 100644 --- a/src/rendering/performance_hud.cpp +++ b/src/rendering/performance_hud.cpp @@ -461,7 +461,7 @@ void PerformanceHUD::render(const Renderer* renderer, const Camera* camera) { ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.5f, 1.0f), "Movement"); ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1.0f), "WASD: Move/Strafe"); - ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1.0f), "Q/E: Turn left/right"); + ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1.0f), "Q/E: Strafe left/right"); ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1.0f), "Space: Jump"); ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1.0f), "X: Sit/Stand"); ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1.0f), "~: Auto-run"); diff --git a/src/ui/keybinding_manager.cpp b/src/ui/keybinding_manager.cpp index fbe70e33..cb7093b0 100644 --- a/src/ui/keybinding_manager.cpp +++ b/src/ui/keybinding_manager.cpp @@ -47,6 +47,10 @@ ImGuiKey KeybindingManager::getKeyForAction(Action action) const { } void KeybindingManager::setKeyForAction(Action action, ImGuiKey key) { + // Q is reserved for movement (strafe-left) and must never open quest log. + if (action == Action::TOGGLE_QUEST_LOG && key == ImGuiKey_Q) { + key = ImGuiKey_None; + } bindings_[static_cast(action)] = key; } @@ -175,9 +179,14 @@ void KeybindingManager::loadFromConfigFile(const std::string& filePath) { } } - if (key != ImGuiKey_None) { - bindings_[actionIdx] = key; + if (key == ImGuiKey_None) continue; + + // Q is reserved for movement (strafe-left) and must never open quest log. + if (actionIdx == static_cast(Action::TOGGLE_QUEST_LOG) && key == ImGuiKey_Q) { + continue; } + + bindings_[actionIdx] = key; } file.close();