Joystick
Joystick copied to clipboard
Xinput support request
Hello, maybe I am wrong but in my understanding this library emulates a Direct Input joystic and not an Xinput joystick. Would it be possibile to extend the compatibility to Xinput device? Thanks for all the amazing work so far :)
Dear @baritonomarchetto ,
you are right regarding the DirectInput Joystick. Unfortunately, this library might not be the correct place to add XInput functionality:
Basically, I just provide an Arduino library which maps the classic Joystick.xxx calls to the already implemented TinyUSB Gamepad, which is not located here, but in the arduino-core from Earle Philhower, I've also described this issue here: https://github.com/benjaminaigner/Joystick/issues/3
I relate on the methods "tud_hid_n_gamepad_report", which are implemented in the Adafruit_TinyUSB_Arduino project. If you want to have an XInput device, it is necessary to:
- implement the HID report descriptor (https://github.com/adafruit/Adafruit_TinyUSB_Arduino/blob/master/src/class/hid/hid_device.h)
- implement the xinput_report (https://github.com/adafruit/Adafruit_TinyUSB_Arduino/blob/master/src/class/hid/hid_device.c)
Nevertheless, it would be a really nice feature for this RP2040 Arduino core, but even if would have time to implement, I personally would create a new repository/library.
Thank you Benjamin. In my hopes Xinput was already implemented in TinyUSB, but it is not. Nor it looks to be easy to add. Are you planning to create that new joystick library eventually? I can see different tries for the Pico online, but nothing as good as dmadison's Xinput arduino library out there... (Thanks for the help so far!)