FS#131 - Add mouse position to the sf::Event::MouseWheelMoved event
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1249 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
0d66fa1776
commit
688a8f15da
9 changed files with 32 additions and 4 deletions
|
@ -532,9 +532,17 @@ void WindowImplWin32::ProcessEvent(UINT message, WPARAM wParam, LPARAM lParam)
|
|||
// Mouse wheel event
|
||||
case WM_MOUSEWHEEL :
|
||||
{
|
||||
// Mouse position is in screen coordinates, convert it to window coordinates
|
||||
POINT position;
|
||||
position.x = LOWORD(lParam);
|
||||
position.y = HIWORD(lParam);
|
||||
ScreenToClient(myHandle, &position);
|
||||
|
||||
Event event;
|
||||
event.Type = Event::MouseWheelMoved;
|
||||
event.MouseWheel.Delta = static_cast<Int16>(HIWORD(wParam)) / 120;
|
||||
event.MouseButton.X = position.x;
|
||||
event.MouseButton.Y = position.y;
|
||||
SendEvent(event);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue