Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.

Mouse wheel windows #75

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions lib/source/gainput/mouse/GainputInputDeviceMouseWin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
}
Expand Down Expand Up @@ -101,6 +109,10 @@ class InputDeviceMouseImplWin : public InputDeviceMouseImpl
buttonId = MouseButton3;
pressed = true;
}
else
{
return;
}
break;
}
default: // Non-mouse message
Expand Down