fix(input): reserve Q for strafe-left

This commit is contained in:
Kelsi 2026-03-14 03:37:24 -07:00
parent 6cfb439fd6
commit 565c78d141
2 changed files with 12 additions and 3 deletions

View file

@ -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");

View file

@ -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<int>(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<int>(Action::TOGGLE_QUEST_LOG) && key == ImGuiKey_Q) {
continue;
}
bindings_[actionIdx] = key;
}
file.close();