Archived

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

JwayneT

Hey, anyone know a windows mouse function?

Recommended Posts

JwayneT    122
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
Turner Brown    122
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
Ironblayde    130
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