[SDL] SDL_MOUSEBUTTONUP doesnt report for the right mouse button?

Josh Matthews mrlachatte at gmail.com
Thu Jun 23 16:40:30 PDT 2005


I'm guessing that you didn't mean this:

case SDL_BUTTON_RIGHT:
//this is never reached
state.mousebutton_left = false;
break;

Note the emphasis on left, in the right mouse button handler. I think that's 
the problem you should actually be concerned about =)

Josh

On 6/24/05, Matt Pruett <entelin at logicaldreams.net> wrote:
> ive got this code here that sets mouse state vars according to the
> events. It all works fine other than one thing, upon releasing the
> right mouse button MOUSEBUTTONUP does not occur. The others work fine. I
> tried another mouse too just to make sure but I got the same results.
> 
> switch (event.type)
> {
> case SDL_MOUSEBUTTONDOWN:
> switch (event.button.button)
> {
> case SDL_BUTTON_LEFT:
> state.mousebutton_left = true;
> break;
> 
> case SDL_BUTTON_MIDDLE:
> state.mousebutton_middle = true;
> break;
> 
> case SDL_BUTTON_RIGHT:
> state.mousebutton_right = true;
> break;
> 
> default:
> break;
> }
> break;
> 
> case SDL_MOUSEBUTTONUP:
> switch (event.button.button)
> {
> case SDL_BUTTON_LEFT:
> state.mousebutton_left = false;
> break;
> 
> case SDL_BUTTON_MIDDLE:
> state.mousebutton_middle = false;
> break;
> 
> case SDL_BUTTON_RIGHT:
> //this is never reached
> state.mousebutton_left = false;
> break;
> 
> default:
> //this is not reached either
> break;
> }
> break;
> }
> --
> Matt Pruett <entelin at logicaldreams.net>
> 
> 
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20050624/3c7cada1/attachment-0008.htm>


More information about the SDL mailing list