-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Update gamepads_windows to use a newer API #31
Comments
After some experimentation, I have some comments about this. Windows.Gaming.Input manages input devices and events. It seems like we would need to look at other Windows APIs for other features. The two 'core' classes representing devices of concern are: A particular device may be recognised as a RawGameController and it may also be recognised as a Gamepad. For instance, I found the Switch Pro Controller was recognised as a Gamepad and a RawGameController when connected via Bluetooth, and only as a RawGameController when connected via USB. RawGameController has a number of properties such as device name and hardware device ID that can also vary depending on the connection type. E.g. I observed RawGameController.DisplayName with a value of "HID-compliant game controller" for most controller and connection type combinations, but notably when an Xbox Series S/X controller was connected via USB it was reported as "Xbox One Game Controller". |
This comment was marked as off-topic.
This comment was marked as off-topic.
This GitHub issue describes rewriting the Windows plugin to use a new API, it is not directly related to any problems people may be facing with the current implementation of gamepads_windows. |
This sounds promising:
However it is distributed via NuGet, which does not play well with CMake according to this issue. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Any progress on this? I added support for web on this package but I don't like the old windows implementation so I had to remove/ reimplement the windows package. How xinput_gamepad is implemented is perfect for me. |
gamepads_windows
currently appears to use the Joysticks API. As per its documentation, it has now been superseded by Windows.Gaming.Input, which provides some functionality comparable to the Game Controller Library provided by Apple.There is a larger project to make Windows APIs accessible as Dart packages via FFI. One such package is
windows_gaming
. https://github.com/halildurmus/dartwinrt/tree/main/packages/windows_gamingIt may be worth exploring making use of this package.
EDIT: I've come to understand that migrating to this API may affect compatibility with controllers that don't support XInput.
The text was updated successfully, but these errors were encountered: