Let me guess. The only place this functionality is "documented" is in the SDL source code, right? If I can figure out how it works, I'll add mouse wheel support to GG, and our app can use that.
Edit: Specifically, how do you get the amount of scrolling up/down from the pair of flags SDL_BUTTON_WHEELUP and SDL_BUTTON_WHEELDOWN? Is there something else in the button state that indicates scrolled distance?
For the windows platform, here's how mouse wheel messages are generated.
From SDL's src/video/wincommon/SDL_sysevents.c:
Code:
case WM_MOUSEWHEEL:
if ( SDL_VideoSurface && ! DINPUT_FULLSCREEN() ) {
int move = (short)HIWORD(wParam);
if ( move ) {
Uint8 button;
if ( move > 0 )
button = SDL_BUTTON_WHEELUP;
else
button = SDL_BUTTON_WHEELDOWN;
posted = SDL_PrivateMouseButton(
SDL_PRESSED, button, 0, 0);
posted |= SDL_PrivateMouseButton(
SDL_RELEASED, button, 0, 0);
}
}
return(0);
Notice that move, which is an integer value, is converted effectively into a bool that means up or down. The distance is excluded. For the DirectX DirectInput code, it does the exact same thing; it takes the amount of movement of the wheel and converts it do up or down only.
Tyreth, do you remember how well this works under Linux? Is it pretty smooth?