• Advertisement
Sign in to follow this  

Direct Input Mouse Properties

This topic is 3765 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to use IDirectInputDevice8::GetProperty( DIPROP_RANGE or etc, &xxxxxxx ) to obtain the information about axes on the mouse. I'm using the default data format (c_dfDIMouse2), so I'm not exactly sure how it's organized. Does anyone know how I can obtain the offset information to pass as the second parameter? When trying to do this with a generic device, I have something like this:
DIPROPRANGE Range;
Range.diph.dwSize = sizeof(DIPROPRANGE);
Range.diph.dwHeaderSize = sizeof(DIPROPHEADER);
Range.diph.dwHow = DIPH_BYOFFSET;
Range.diph.dwObj = axis_index * sizeof(int); // The offset of the axis
Device->GetProperty(DIPROP_RANGE,&Range.diph);
But that's because I set custom data formats which have axes at the beginning of the buffered data. Does anyone know if this is how Direct Input has the default mouse format set up as well? By the way, does anyone know if using this default format is a crutch? Apparently, only one extra mouse axis (the wheel) can be represented with it. Are there not more advanced mice out there by now with at least two secondary spinners or axes?

Share this post


Link to post
Share on other sites
Advertisement
Is there some reason that you must get the object by offset? If not, try using the ID by enumerating the object you want with EnumObjects and getting its DIDEVICEOBJECTINSTANCE.

Share this post


Link to post
Share on other sites
No, there's no reason I can't use the ID. It's been a while since I've played around with Direct Input, so I didn't realize that could be done.

I'm actually considering dropping the use of c_dfDIMouse2 and just obtaining the mouse like any other generic device. Are there any disadvantages to doing this? The Direct Input data offsets are very useful for the keyboard, since DIK_* values can be used, but the default mouse format doesn't seem nearly as helpful.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement