Jump to content
  • Advertisement
Sign in to follow this  
MARS_999

SDL_MOUSEMOTION and right mouse button

This topic is 2784 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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.

Share this post


Link to post
Share on other sites
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
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!