Skip to main content
GameDev.net gamedev.net
🔒 Locked

Get mouse buttons state without DXInput ?

Started by Skeleton_V@T Oct 19, 2005 at 4:58 AM 2 replies 1.1k views
Original Post
Skeleton_V@T
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. [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 <--
oliii
oliii
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.
Assemblor
Assemblor
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.
Skeleton_V@T
Skeleton_V@T
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 <--

Topic Locked

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

Sign in to reply to this topic.