You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have my own HID gamepad device that I'm trying to link up with SDL. I'm trying to get to the bottom of this intermittent issue: OrangeFox86/DreamPort#112
TLDR: On first press of either trigger, the input value will jump to 50%, and the full range will be 50-100% instead of the desired 0-100% - only sometimes happens on Windows systems, but if it starts happening, it seems to persist from run to run.
I've determined that it's some kind of bug in DInput since the values coming out of IDirectInputDevice8_GetDeviceData() have a lower bound of 0 when this occurs i.e. the value of evtbuf[i].dwData @ https://github.com/libsdl-org/SDL/blob/main/src/joystick/windows/SDL_dinputjoystick.c#L1095. It's only a problem on Windows - we haven't seen this on Linux or MacOS. My device is sending values within the full range described in the HID descriptor. The online gamepad tester always provides correct results for the triggers.
For some reason, I have found that calling SDL_JoystickGetDeviceInstanceID() just after the joystick is enumerated and opened with SDL_JoystickOpen somehow kicks DInput to start giving correct values.
I'm wondering if there is some sort of workaround that could be built into SDL if I can determine "why" this workaround works.
Has anything like this been reported before?
The text was updated successfully, but these errors were encountered:
OS: Windows
I have my own HID gamepad device that I'm trying to link up with SDL. I'm trying to get to the bottom of this intermittent issue: OrangeFox86/DreamPort#112
TLDR: On first press of either trigger, the input value will jump to 50%, and the full range will be 50-100% instead of the desired 0-100% - only sometimes happens on Windows systems, but if it starts happening, it seems to persist from run to run.
I've determined that it's some kind of bug in DInput since the values coming out of
IDirectInputDevice8_GetDeviceData()
have a lower bound of 0 when this occurs i.e. the value ofevtbuf[i].dwData
@ https://github.com/libsdl-org/SDL/blob/main/src/joystick/windows/SDL_dinputjoystick.c#L1095. It's only a problem on Windows - we haven't seen this on Linux or MacOS. My device is sending values within the full range described in the HID descriptor. The online gamepad tester always provides correct results for the triggers.For some reason, I have found that calling
SDL_JoystickGetDeviceInstanceID()
just after the joystick is enumerated and opened withSDL_JoystickOpen
somehow kicks DInput to start giving correct values.The text was updated successfully, but these errors were encountered: