Mouse wheel up/down issue

Hello all,

I’m having some trouble reading mouse wheel up/down inputs…
I was wondering if there’s a known issue, or if I’m doing something wrong…

Here’s how I test for it:

int *x;
int *y;
Uint8 state = SDL_GetMouseState(x, y);

bool wheelUp = state & SDL_BUTTON(SDL_BUTTON_WHEELUP);

It turns out, wheelUp is always false…
(This is on FC5 in case it’s of any relevance).

Any ideas? Does anything look wrong with the code above?

Cheers,
K.

Hello Kostas,

Monday, May 15, 2006, 9:49:49 AM, you wrote:

KK> Hello all,

KK> I’m having some trouble reading mouse wheel up/down inputs…
KK> I was wondering if there’s a known issue, or if I’m doing something wrong…

KK> Here’s how I test for it:

KK> int *x;
KK> int *y;
KK> Uint8 state = SDL_GetMouseState(x, y);

KK> bool wheelUp = state & SDL_BUTTON(SDL_BUTTON_WHEELUP);

KK> It turns out, wheelUp is always false…
KK> (This is on FC5 in case it’s of any relevance).

KK> Any ideas? Does anything look wrong with the code above?

You cant guarantee that you’ll catch the wheel-up event as it’s
momentary. Really, you need to do this with the event system.–
Best regards,
Peter mailto:@Peter_Mulholland

Kostas Kostiadis wrote:

Hello all,

I’m having some trouble reading mouse wheel up/down inputs…
I was wondering if there’s a known issue, or if I’m doing something wrong…

Here’s how I test for it:

int *x;
int *y;
Uint8 state = SDL_GetMouseState(x, y);

bool wheelUp = state & SDL_BUTTON(SDL_BUTTON_WHEELUP);

From your code fragment it’s not clear. I think you should test
this from inside an event handler (SDL_MouseButtonEvent).

 .bill