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;
}
SDL_MouseButtonEvent
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 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.
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.
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
Popular Topics
Advertisement
Recommended Tutorials
Advertisement