Revert "fix(input): block WASD and Q/E movement"

This reverts commit 8391f93ca6.
This commit is contained in:
Kelsi 2026-03-14 03:46:10 -07:00
parent 8391f93ca6
commit a09a24e58e
2 changed files with 8 additions and 7 deletions

View file

@ -225,17 +225,13 @@ void CameraController::update(float deltaTime) {
bool keyD = !uiWantsKeyboard && !sitting && !movementSuppressed && input.isKeyPressed(SDL_SCANCODE_D);
bool keyQ = !uiWantsKeyboard && !sitting && !movementSuppressed && input.isKeyPressed(SDL_SCANCODE_Q);
bool keyE = !uiWantsKeyboard && !sitting && !movementSuppressed && input.isKeyPressed(SDL_SCANCODE_E);
// Keyboard movement keys are blocked (movement only).
// Mouse autorun (L+R) and other non-movement keys remain functional.
keyW = keyS = keyA = keyD = keyQ = keyE = false;
bool shiftDown = !uiWantsKeyboard && (input.isKeyPressed(SDL_SCANCODE_LSHIFT) || input.isKeyPressed(SDL_SCANCODE_RSHIFT));
bool ctrlDown = !uiWantsKeyboard && (input.isKeyPressed(SDL_SCANCODE_LCTRL) || input.isKeyPressed(SDL_SCANCODE_RCTRL));
bool nowJump = !uiWantsKeyboard && !sitting && !movementSuppressed && input.isKeyJustPressed(SDL_SCANCODE_SPACE);
bool spaceDown = !uiWantsKeyboard && !sitting && !movementSuppressed && input.isKeyPressed(SDL_SCANCODE_SPACE);
// Idle camera: any input resets the timer; timeout triggers a slow orbit pan
bool anyInput = leftMouseDown || rightMouseDown || nowJump;
bool anyInput = leftMouseDown || rightMouseDown || keyW || keyS || keyA || keyD || keyQ || keyE || nowJump;
if (anyInput) {
idleTimer_ = 0.0f;
} else if (!introActive) {
@ -401,7 +397,11 @@ void CameraController::update(float deltaTime) {
// Stand up on any movement key or jump while sitting (WoW behaviour)
if (!uiWantsKeyboard && sitting && !movementSuppressed) {
bool anyMoveKey = input.isKeyPressed(SDL_SCANCODE_SPACE);
bool anyMoveKey =
input.isKeyPressed(SDL_SCANCODE_W) || input.isKeyPressed(SDL_SCANCODE_S) ||
input.isKeyPressed(SDL_SCANCODE_A) || input.isKeyPressed(SDL_SCANCODE_D) ||
input.isKeyPressed(SDL_SCANCODE_Q) || input.isKeyPressed(SDL_SCANCODE_E) ||
input.isKeyPressed(SDL_SCANCODE_SPACE);
if (anyMoveKey) sitting = false;
}

View file

@ -460,7 +460,8 @@ void PerformanceHUD::render(const Renderer* renderer, const Camera* camera) {
ImGui::Separator();
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.5f, 1.0f), "Movement");
ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1.0f), "WASD/QE: Blocked");
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: 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");