Advertisement

SDL_MouseButtonEvent

Started by November 04, 2004 12:31 AM
1 comment, last by Gaiiden 20 years, 3 months ago
Hi... I'm used to windows programming...but recently have been doing some work with SDL..I'm wondering how to access the things in SDL that would be like the wParam, and lParam would be in Windows.. for example when i have a


switch (event.type)
{
case SDL_MOUSEBUTTONDOWN:
//now I would like to know which mouse button was clicked
//and the x and the y coordinates
break;
}


I realize this is a very easy basic question but I can't figure it out! I see all these SDL_MouseButtonEvent structures and such..but where do they come from? Thanks a bunch
To access information about the mouse button event, you would use the button member of event. e.g.: event.button.button would tell you which button was pressed, event.button.x would tell you the x coordinate of the mouse when the button was pressed, and so on.
Advertisement
Check out the full structure listings.

Start with the SDL_Event structure, and you'll notice it contains every other structure on the list. So for keyboard, mouse and other events, use this structure list to see how to access the various event properties.

Drew Sikora
Executive Producer
GameDev.net

This topic is closed to new replies.

Advertisement