Under windows/sfml2 i enountered a problem where Event::MouseWheelEvent::Delta is almost allways zero, you need to scroll the wheel REALLY fast to obtain some other sensible value. After taking a look at the ProcessEvent function in /src/SFML/Window/Win32/WindowImplWin32.cpp, i found this:
// Mouse wheel event
case WM_MOUSEWHEEL :
{
// Mouse position is in screen coordinates, convert it to window coordinates
POINT position;
position.x = static_cast<Int16>(LOWORD(lParam));
position.y = static_cast<Int16>(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;
PushEvent(event);
break;
}
Now, after carefully reading
http://msdn.microsoft.com/en-us/library/ms645617(v=vs.85).aspx, the following was noticed:
The high-order word indicates the distance the wheel is rotated, expressed in multiples or divisions of WHEEL_DELTA, which is 120.
so it becomes appearent that
event.MouseWheel.Delta = static_cast<Int16>(HIWORD(wParam)) / 120;
sets Delta to zero whenever the absolute value of HIWORD(wParam) is less than 120, which happens to be quite often.
After taking a look at the Linux implementation:
event.MouseWheel.Delta = windowEvent.xbutton.button == Button4 ? 1 : -1;
which can return only 1 or -1 i believe the windows one should be changed to something like
event.MouseWheel.Delta = static_cast<Int16>(HIWORD(wParam)) > 0 ? 1 : -1;
as well, or make Delta a float to allow fractional values.