Detecting scroll wheel up and scroll wheel down in OS X?

Recently I’ve been trying to detect for scroll wheel movements in OS X
with:

if(SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(SDL_BUTTON_WHEELUP))
{blah}

For some reason I cannot for the life of me get this to work. Whenever
I test for this it never registers, no matter what button I press, or
what I do with my mouse (even sticking it in the microwave didn’t
help!). I’m using SDL 1.2.7 (stable), any help is greatly
appreciated…probably because I might just be nuts.

Thanks
Derek

/*
http://www.derekarndt.com game development is just my forte
*/
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: text/enriched
Size: 759 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040226/dd1fa367/attachment.bin

Derek Arndt wrote:

Recently I’ve been trying to detect for scroll wheel movements in OS X
with:

if(SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(SDL_BUTTON_WHEELUP)) {blah}

Detect this while processing sdl-events. Something like this:

while( SDL_PollEvent( &event ) ) {
switch( event.type ) {
case SDL_MOUSEBUTTONDOWN: {
if( event.button.button == 4)
cerr << “mouse wheel up” << endl;
if( event.button.button == 5)
cerr << “mouse wheel down” << endl;
} break;
}

…or maybe it’s the other way around :slight_smile:

Cheers,
\Mikkel Gjoel