stride icon indicating copy to clipboard operation
stride copied to clipboard

feat: Adds the 8BitDo layout to for proper GamePad support.

Open Doprez opened this issue 7 months ago • 4 comments

PR Details

Currently 8BitDo controllers dont have a registered layout so they will not work as GamePads. This adds the vendor Id and layout so that it will work outside of an XInput context.

Related Issue

No related issues, I found this by trying to use SDL on linux and the GamePad always being null.

Types of changes

  • [ ] Docs change / refactoring / dependency upgrade
  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • [ ] My change requires a change to the documentation.
  • [ ] I have added tests to cover my changes.
  • [ ] All new and existing tests passed.
  • [x] I have built and run the editor to try this change out.

Doprez avatar May 17 '25 01:05 Doprez

Do you have a link to the vendor specs? If so can it be added as comment?

We might need to do fixes in the future so it's good to have a reference.

Kryptos-FR avatar May 17 '25 10:05 Kryptos-FR

Unfortunately not a full spec sheet I only have the vendor Id and product Id from the mapping on my machine \\?\hid#vid_2dc8&pid_310a ... and using Device Hunt and there is the USB spec sheet for general USB debugging https://www.usb.org/sites/default/files/hut1_4.pdf

Although its important to note that this mapping is probably only useful for the SDL context since the mappings are coming from the JoyStick controller mappings so maybe I should check that this is also coming from the SDL input source?

Doprez avatar May 17 '25 13:05 Doprez

Moving this to draft, let us know when you're done working on this one :)

Eideren avatar Aug 27 '25 15:08 Eideren

Makes sense, I think I may replace this with a more generic solution because of the "only useful for the SDL context since the mappings are coming from the JoyStick controller mappings" issue.

I did start using the HIDDevice lib from DevDecoder so that the controllers would work consistently between different windowing backends.

https://github.com/Doprez/Doprez.Stride.MoreInput/blob/main/src/GameControllerHIDDevice.cs

Doprez avatar Aug 27 '25 15:08 Doprez