Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

JwayneT

Hey, anyone know a windows mouse function?

This topic is 6375 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

You know how windows has GetAsyncKeyState(), I was wondering if it had anything like that for the mouse. You know, a function that took two paramiters by refrence, one for x and one for y. It''s so I don''t have to use DirectInput.

Share this post


Link to post
Share on other sites
Advertisement
GetAsyncKeyState(VK_LBUTTON), and GetAsyncKeyState(VK_RBUTTON) get the states of the left and right mouse buttons, respectively. If it is a 3 button mouse, VK_MBUTTON gets the middle button.

GetCursorPos takes a POINT as a parameter.
for example -

POINT position;
GetCursorPos(position);
//position.x would be the x position
//position.y would be the y position

Share this post


Link to post
Share on other sites
You can always just look at the Windows messages that relate to the mouse:

WM_MOUSEMOVE
WM_LBUTTONDOWN
WM_LBUTTONUP
WM_LBUTTONDBLCLK
WM_RBUTTONDOWN
WM_RBUTTONUP
WM_RBUTTONDBLCLK

Those may not be exactly right (I''m away from home, no MSDN...) but you get the idea. I''m pretty sure there is a message or two for the wheel also, if you wanted to do something with that.

-Ironblayde
 Aeon Software

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!