DIMOUSESTATE2

Started by
4 comments, last by darkelf2k5 18 years, 4 months ago
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.
Advertisement
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.
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
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.
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
If I remember correctly, 0 is left, 1 is right, and 2 is middle as vore2005 indicated.
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.
Every time you implement a singleton, God kills a kitten. Please, think of the kittens!

This topic is closed to new replies.

Advertisement