tinyusb icon indicating copy to clipboard operation
tinyusb copied to clipboard

Adding XInput library

Open Huckies opened this issue 3 years ago • 4 comments

While the existing examples include several DirectInput ones, the emulation of recent xbox controllers is missing. Xbox controllers are very common today, many games don't accept the input from a DirectInput device, so I think it'll be useful. Here is a repo that may help: https://github.com/FeralAI/MPG

Huckies avatar Feb 20 '22 05:02 Huckies

I assume non standard class drivers are a non-goal of this project. I have a xinput USB host driver for TinyUSB, https://github.com/Ryzee119/tusb_xinput, but 'emulating them' as a usb device shouldnt be hard if someone hasnt already done this.

Ive done Original Xbox controllers before, however those arent 'X-input'.

Ryzee119 avatar Feb 20 '22 10:02 Ryzee119

@Ryzee119 Thank you for replying! I build my own driver refer to the repo I mentioned and finally get a device called 'Xbox 360 Controller for Windows' is that the goal? Because my first aim was to get a 'Xbox One Controller', am I getting a wrong descriptor or something else?

Huckies avatar Feb 21 '22 07:02 Huckies

Thank for your issue, to be honest, I am not familiar with xinput and xbox controller ( I dont have one to test it out), however, we can thing easier for user with predefined hid descriptor and structure report. I could made an example for ps4 controller since it is what I have. Hopefully that would pave the way for adding similar pr for xbox one. Will post ps4 here whenever it is available

hathach avatar Mar 06 '22 03:03 hathach

Thank you for that:) I've done my implementation of an Xbox 360 controller since cracking an Xbox One controller might not be legal, although in a rough way. I could post my code later if you are interested, it'll be great to have it polished and be a part of the tinyusb stack.

Huckies avatar Mar 06 '22 04:03 Huckies