I'm developing a usb device using a HID descriptor and I have a catch 22 here. I have a controller that has two shoulder pressure buttons. I need a range from 0-255 with 0 being the resting point. In the various software gaming apps when mapping buttons it listens for a movement. If the shoulder is at 0 to 128 nothing is detected but at anything > than 128 it is detected. Windows DX seems to see shoulder at reset as 255 and fully pressed as 0. So I figure well this is easy, I'll reverse the value in the device firmware val = 255-val; Doing this makes Windows DX see the shoulder at rest as 0 and fully pressed as 255. Great right? Now DX sees shoulder at 255 to 128 as nothing detected and anything < 128 as detected.
Hope that was not too confusing. So I then came up with the idea of making 128 the resting point. This passes the detection and in game the value is always 128. So that is no good.
I dont know if the problem is the usb descriptor or that most software is written poorly.
Here is my analog portion of the usb descriptor
//axis
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x30, // USAGE (X)
0x09, 0x31, // USAGE (Y)
0x09, 0x32, // USAGE (Z)
0x09, 0x33, // USAGE (Rx)
0x09, 0x34, // USAGE (Ry)
0x09, 0x35, // USAGE (Rz)
0x09, 0x36, // USAGE slider
0x09, 0x37, // USAGE dial
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255)
0x35, 0x00, // Physical Minimum (0)
0x46, 0xFF, 0x00, // Physical Minimum (255)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x08, // REPORT_COUNT (8)
0x81, 0x02, // INPUT
All values are 0-255 If needed I can break the slider and dial out and give it another range but nothing seems to help any. Hiw does one handel a presure button if DX always looks for <> 128 to sense a change in movment?