From 9b60587be96c6322a5947533e9ad07dbadf65487 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Mon, 13 Jun 2011 17:37:13 -0500 Subject: [PATCH] [InputHandler_DirectInput] Fixed MouseWheel input not resetting. --- Docs/Changelog_sm5.txt | 1 + src/arch/InputHandler/InputHandler_DirectInput.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index bf62e25f8c..874e230a6e 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -10,6 +10,7 @@ StepMania 5.0 Preview 2 | 20110??? 2011/06/13 ---------- +* [InputHandler_DirectInput] Fixed MouseWheel input not resetting. [AJ] * [ScreenTextEntry] Make it so only the keyboard's Enter key can finish the screen. Should fix issues with buttons whose secondary function is MenuStart. [AJ] * [InputMapper] Modify default mappings. Use the Hyphen key instead of the diff --git a/src/arch/InputHandler/InputHandler_DirectInput.cpp b/src/arch/InputHandler/InputHandler_DirectInput.cpp index 9817a88d0d..42d8387441 100644 --- a/src/arch/InputHandler/InputHandler_DirectInput.cpp +++ b/src/arch/InputHandler/InputHandler_DirectInput.cpp @@ -384,6 +384,10 @@ void InputHandler_DInput::UpdatePolled( DIDevice &device, const RageTimer &tm ) if( hr == DIERR_INPUTLOST || hr == DIERR_NOTACQUIRED ) return; + // reset mousewheel + ButtonPressed( DeviceInput(device.dev, MOUSE_WHEELUP, 0, tm) ); + ButtonPressed( DeviceInput(device.dev, MOUSE_WHEELDOWN, 0, tm) ); + for( unsigned i = 0; i < device.Inputs.size(); ++i ) { const input_t &in = device.Inputs[i]; @@ -476,6 +480,12 @@ void InputHandler_DInput::UpdateBuffered( DIDevice &device, const RageTimer &tm return; } + // reset mousewheel + DeviceInput diUp = DeviceInput(device.dev, MOUSE_WHEELUP, 0.0f, tm); + ButtonPressed( diUp ); + DeviceInput diDown = DeviceInput(device.dev, MOUSE_WHEELDOWN, 0.0f, tm); + ButtonPressed( diDown ); + for( int i = 0; i < (int) numevents; ++i ) { for(unsigned j = 0; j < device.Inputs.size(); ++j) @@ -522,6 +532,7 @@ void InputHandler_DInput::UpdateBuffered( DIDevice &device, const RageTimer &tm GetCursorPos(&cursorPos); // convert screen coordinates to client ScreenToClient(GraphicsWindow::GetHwnd(), &cursorPos); + switch(in.ofs) { case DIMOFS_X: