Get mouse buttons state without DXInput ?

Started by
2 comments, last by Skeleton_V@T 18 years, 7 months ago
Hi!. Can anyone tell me how to get mouse buttons state (Up/Down) wihout using DXInput and Windows messages ?. Is there any function ?. I had everything I need for input but the mouse buttons state!. The MSDN doesn't refer to any functions that related this. [Edited by - Skeleton_V@T on December 24, 2005 11:05:56 AM]
--> The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones <--
Advertisement
Quote:Original post by Skeleton_V@T
Hi!.
Can anyone tell me how to get mouse buttons state (Up/Down) wihout using DXInput and Windows messages ?. Is there any function ?. I had everything I need for input but the mouse buttons state!. The MSDN doesn't refer to any functions that related this.


only through windows message handler.

WM_LBUTTONDOWN
WM_LBUTTONUP
WM_MOUSEMOVE
.....


A DXinput mouse handler isn't terribly hard to do though :)

Everything is better with Metal.

Try GetAsyncKeyState( VK_LBUTTON )

From MSDN:

Remarks:
The GetAsyncKeyState function works with mouse buttons. However, it checks on the state of the physical mouse buttons, not on the logical mouse buttons that the physical buttons are mapped to. For example, the call GetAsyncKeyState(VK_LBUTTON) always returns the state of the left physical mouse button, regardless of whether it is mapped to the left or right logical mouse button.
Doh!
Ouch! Thanks for the reply, I almost forgot this handy function.
oliii: DXInput is quite easy to use but it's functions are much more than I needed. I only need to get some basic levels of input, but thanks afterall :).

Using Windows messages makes my framework to be more dependent however :(.
--> The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones <--

This topic is closed to new replies.

Advertisement