diff --git a/lib/source/gainput/mouse/GainputInputDeviceMouseWin.h b/lib/source/gainput/mouse/GainputInputDeviceMouseWin.h index 53e3efb4..160866db 100644 --- a/lib/source/gainput/mouse/GainputInputDeviceMouseWin.h +++ b/lib/source/gainput/mouse/GainputInputDeviceMouseWin.h @@ -33,8 +33,16 @@ class InputDeviceMouseImplWin : public InputDeviceMouseImpl delta_ = delta; // Reset mouse wheel buttons - HandleButton(device_, nextState_, delta_, MouseButton3, false); - HandleButton(device_, nextState_, delta_, MouseButton4, false); + auto resetWheel = [&](const DeviceButtonId buttonId) { + const bool oldValue = previousState_->GetBool(buttonId); + if (oldValue) + { + const bool pressed = false; + HandleButton(device_, nextState_, delta_, buttonId, pressed); + } + }; + resetWheel(MouseButton3); + resetWheel(MouseButton4); *state_ = nextState_; } @@ -101,6 +109,10 @@ class InputDeviceMouseImplWin : public InputDeviceMouseImpl buttonId = MouseButton3; pressed = true; } + else + { + return; + } break; } default: // Non-mouse message