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:
LaurentGom 2009-10-27 15:56:16 +00:00
parent 0d66fa1776
commit 688a8f15da
9 changed files with 32 additions and 4 deletions

View file

@ -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;
}