Sign in to follow this  
MARS_999

SDL_MOUSEMOTION and right mouse button

Recommended Posts

MARS_999    1627
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!

Share this post


Link to post
Share on other sites
SimonForsman    7642
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.

Share this post


Link to post
Share on other sites
MARS_999    1627
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...

Share this post


Link to post
Share on other sites
SimonForsman    7642
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)

Share this post


Link to post
Share on other sites
MARS_999    1627
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this