Skip to main content
gamedev.net
🔒 Locked

Mouse Input

Started by Dany Mar 12, 2003 at 4:48 PM 1 replies 350+ views
Original Post
Dany
Dany
Dose anyone have an idea how to track held mouse button in SDL?
Xorcist
Xorcist
I would most likely use SDL_GetRelativeMouseState (or SDL_GetMouseState with a little extra code) while performing a check for the particular button in question, and basing my results off of that. For example if I wanted to know how where the mouse moved from, and to where, while a button was being held down.

Both functions return a bit string that determines which buttons are currently pressed, and also take two parameters which will be filled with the respective x and y mouse coordinates. Check the documentation site listed in the last post for a good overview, or just do a quick search for the functions on Google.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.