Sign in to follow this  
derek7

DIMOUSESTATE2

Recommended Posts

how to know which button is press? LONG lX; LONG lY; LONG lZ; BYTE rgbButtons[8]; rgbButtons Array of buttons. The high-order bit of the byte is set if the corresponding button is down. msdn is ambiguity.

Share this post


Link to post
Share on other sites
You just to it like any other DInput state:


if( myState.rgbButtons[0] & 0x80 )
{
// Button 0 is down
}


When they say "high-order bit is set", just do the "& 0x80" test on it.

Share this post


Link to post
Share on other sites
Quote:
Original post by circlesoft
You just to it like any other DInput state:


if( myState.rgbButtons[0] & 0x80 )
{
// Button 0 is down
}


When they say "high-order bit is set", just do the "& 0x80" test on it.


thank but I want to which index is left button ,middle button ,right button.

Share this post


Link to post
Share on other sites
Hi,

I think rgbButtons[0] should be the left button and rgbButtons[1] should be the right button. I'm not sure about the middle button, maybe rgbButtons[2]? If not you can still find out by trial and error.
Vore

Share this post


Link to post
Share on other sites
Quote:
Original post by Dave Hunt
If I remember correctly, 0 is left, 1 is right, and 2 is middle as vore2005 indicated.


I can confirm that. The rest of the layout depends on the mouse itself.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this