Still investigating the driver area:)
I’ve got a 8BitDo SN30 pro (USB) and the QuirkyDevices part need an update to recognize that gamepad.
So far a success because now my SimpleJoystick program is recognizing it:
I will look in more details later to clean up everything 
8 Likes
Having double checked without my changes, the gamepad is recognized, so nothing to do here.
So now I will investigate how to have it working under non-native applications like ESDE/retroarch (I guess some translations are missing between BeAPI and other libs)
You can check libsdl2 as a reference of how this is used in third party programms
1 Like
I’ve made a quick test with SDL2:
- The gamepad is recognized as SDL_Joystick
- The gamepad is not recognized as SDL_GameController (which might be one of the reason it’s not recognized in Retroarch)
My second gamepad which is more generic is not recognized as SDL_GameController but it’s recognized under retroarch
So I’m not sure if it’s relative to SDL2 or RetroArch. But at least, I would say SDL2 at the moment because I’ve seen that there’s a db mapping " gamecontrollerdb.txt
" to recognize the controllers by platforms for SDL2
I think using this database requires a way to know the USB device and vendor ID for the controller, which the Haiku API doesn’t currently provide or doesn’t implement. There is only a GetDeviceName function (Making sure you're not a bot!) and even that just returns a very generic “USB Joystick 1” or something like that.
So that would require:
- Adding a new API to BJoystick
- Adding a new ioctl to joystick devices so the drivers can return the information
- Wiring the BJoystick class to use the ioctl
- Implementing the new ioctl in the ubb_hid joystick driver
- Adjusting SDL to make use of the new API in BJoystick
Ok thanks for giving these detailed information.
Indeed the current method GetDeviceName is returning something like usb/0, usb/1, etc