From 7a260449345c38df687c72cd3c8eb5cfcd28f952 Mon Sep 17 00:00:00 2001 From: Kyzentun Keeslala Date: Fri, 9 Oct 2015 23:54:35 -0600 Subject: [PATCH] Changed DirectInput mouse input to use an if statement instead of a while loop to avoid input lockup. --- src/arch/InputHandler/InputHandler_DirectInput.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/arch/InputHandler/InputHandler_DirectInput.cpp b/src/arch/InputHandler/InputHandler_DirectInput.cpp index 81cb0fd317..38d3ab23f6 100644 --- a/src/arch/InputHandler/InputHandler_DirectInput.cpp +++ b/src/arch/InputHandler/InputHandler_DirectInput.cpp @@ -539,7 +539,14 @@ void InputHandler_DInput::UpdateBuffered( DIDevice &device, const RageTimer &tm { DeviceInput diUp = DeviceInput(dev, up, 1.0f, tm); DeviceInput diDown = DeviceInput(dev, down, 0.0f, tm); - while( fWheelDelta >= WHEEL_DELTA ) + // This if statement used to be a while loop. But Kevin + // reported that scrolling the mouse wheel locked up input. + // I assume that fWheelDelta was some absurdly large value, + // causing an infinite loop. Changing the while loop to an + // if fixed the input lockup. Anything that wants to + // imitate multiple presses when the wheel is scrolled will + // have to do it manually. -Kyz + if( fWheelDelta >= WHEEL_DELTA ) { ButtonPressed( diUp ); ButtonPressed( diDown ); @@ -551,7 +558,8 @@ void InputHandler_DInput::UpdateBuffered( DIDevice &device, const RageTimer &tm { DeviceInput diDown = DeviceInput(dev, down, 1.0f, tm); DeviceInput diUp = DeviceInput(dev, up, 0.0f, tm); - while( fWheelDelta <= -WHEEL_DELTA ) + // See comment for the l > 0 case. -Kyz + if( fWheelDelta <= -WHEEL_DELTA ) { ButtonPressed( diDown ); ButtonPressed( diUp );