Skip LMB hold threshold for immediate movement when RMB is held

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Christian Semmler 2026-03-27 13:27:21 -07:00
parent c2901d1226
commit 7566d5c468
No known key found for this signature in database
GPG Key ID: 086DAA1360BEEE5C

View File

@ -9,8 +9,8 @@
using namespace Extensions::ThirdPersonCamera; using namespace Extensions::ThirdPersonCamera;
InputHandler::InputHandler() InputHandler::InputHandler()
: m_touch{}, m_wantsAutoDisable(false), m_wantsAutoEnable(false), m_rightButtonHeld(false), : m_touch{}, m_wantsAutoDisable(false), m_wantsAutoEnable(false), m_rightButtonHeld(false), m_leftButtonHeld(false),
m_leftButtonHeld(false), m_leftButtonDownTime(0), m_savedMouseX(0.0f), m_savedMouseY(0.0f) m_leftButtonDownTime(0), m_savedMouseX(0.0f), m_savedMouseY(0.0f)
{ {
} }
@ -79,7 +79,7 @@ bool InputHandler::ConsumeAutoEnable()
bool InputHandler::IsLmbHeldForMovement() const bool InputHandler::IsLmbHeldForMovement() const
{ {
return m_leftButtonHeld && m_leftButtonDownTime > 0 && return m_leftButtonHeld && m_leftButtonDownTime > 0 &&
(SDL_GetTicks() - m_leftButtonDownTime) >= LMB_HOLD_THRESHOLD_MS; (m_rightButtonHeld || (SDL_GetTicks() - m_leftButtonDownTime) >= LMB_HOLD_THRESHOLD_MS);
} }
void InputHandler::SuppressGestures() void InputHandler::SuppressGestures()