views:

361

answers:

3

I use DirectInput to handle input devices, I enumerate devices and elements on each device.

When using the analogue sticks on my game pad, they report values in the range 0-65535. Is this always the case for all types of absolute axis?

If not: is there any way to find out the range of an DX8 input element's DIDEVICEOBJECTDATA::dwData (enumerated with DIDFT_ABSAXIS)? The only other option I can think of is to use some home made internal calibration inside my app, and that sound too '80s to be true.

+4  A: 

Can't you get the range using GetProperty and passing in an appropriate DIPROPRANGE structure to be filled? Use the DIPROP_RANGE GUID.

Goz
This sounds like the answer for me, just have to implement and check. Thanks in advance!
Jonas Byström
A: 

From : http://www.wingmanteam.com/files/Tools/DXTweak/Readme.txt

A game controller driver usually reports axis position information as integer values between 0 and 655 to DirectInput. DirectInput linearly scales these values up to 0 to 65535.

Emmanuel Caradec
+2  A: 
Jonas Byström