-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the process to set a DirectInput device's axis mode more conservative #1634
Conversation
… it is supported. Only attempt setting a DirectInput device's axis mode if the device reports having axes and its axis mode is not already set to absolute. If the axis mode still can't be set to absolute, blacklist the device so that any future attempts will abort early. This should help when dealing with broken device drivers that report being game controllers and not fully supporting game controller functionality.
c3e3328
to
9e45898
Compare
Added support for buffered DirectInput data and a device blacklist to abort attempting to initialize the same device in the future. |
How do i fix this ;( |
@eXpl0it3r
OS: 10.0.18363 |
@binary1248 can you explain this effect? |
If I had to guess, I'd say this check fails: If we can't set the axis mode to absolute although the device reports having axes the entire device is blacklisted. This verification was not done before, we just assumed that it always worked out somehow. Now that it is done we get a whole family of devices/drivers that misbehave or at least don't behave in a way that we can reason about. If we can't guarantee that the device's axis mode is set to absolute, we also can't guarantee that the values reported by our Joystick API are usable, thus this check. If the axis mode was always absolute for said device but it never reported it correctly, then... well... 🤷♂️ Like I said, this is only an educated guess. I don't have the hardware in question, so I can't put this hypothesis to the test. One would have to step through the Joystick code with said controller attached to see what happens and report their findings here. If it is an oversight or something trivial to fix then I have nothing against fixing the code again. |
This patch changes the DirectInput device initialization process to only attempt setting the device's axis mode if the device reports having axes and its axis mode is not already set to absolute. This should help when dealing with broken device drivers that report being game controllers and not fully supporting game controller functionality such as was reported here.
In order to test whether the negative case handling is improved, find someone with such a broken device driver. 😁