SDL_MOUSEMOTION and right mouse button

Started by
3 comments, last by MARS_999 13 years, 6 months ago
When I check the button variable after a SDL_MOUSEMOTION event has happened for button #3, and I did press button 3 I get no response....

Is there a know bug with this? I am using SDL 1.2.14

Thanks!
Advertisement
Quote:Original post by MARS_999
When I check the button variable after a SDL_MOUSEMOTION event has happened for button #3, and I did press button 3 I get no response....

Is there a know bug with this? I am using SDL 1.2.14

Thanks!


how do you check the "button variable" ?

There will never be a SDL_MOUSEMOTION event for a specific button, only for mouse movement, button presses generate SDL_MOUSEDOWN events which should be handled separatly.
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
http://www.libsdl.org/cgi/docwiki.cgi/SDL_MouseMotionEvent

says I can check the state of the button with a SDL_BUTTON() macro...

I will take another look...
Quote:Original post by MARS_999
http://www.libsdl.org/cgi/docwiki.cgi/SDL_MouseMotionEvent

says I can check the state of the button with a SDL_BUTTON() macro...

I will take another look...


the SDL_BUTTON macro is for use with SDL_GetMouseState or it could be used along with the state variable of the SDL_MOUSEMOTION event, but its really not a good idea. (its extremely easy to miss mouseclicks when using it since the button has to be down when the state is queried or the event is generated)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
Thanks SimonForsman, for pointing out the obvious! :) I looked at it again and found that yeah I was sending in a button event down into my MouseMotion() vs. the state variable. I then used the SDL_BUTTON() macro inside to check and works fine now.

This topic is closed to new replies.

Advertisement