We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4955

Summary: Support for composite gamepads
Product: SDL Reporter: Paul Cercueil <paul>
Component: joystickAssignee: Sam Lantinga <slouken>
Status: WAITING --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: glex.spb
Version: HG 2.0   
Hardware: All   
OS: Linux   

Description Paul Cercueil 2020-01-18 19:52:13 UTC
Hi,

I'm the maintainer of OpenDingux which is the Linux distribution that runs on the GCW Zero and other compatible chinese emulation handhelds.

There, the face buttons are mapped to keyboard keys, mostly for legacy reasons, which appears as /dev/input/event1. There is also an analog stick, mapped to /dev/input/event2, and another handheld (RG350) has a second analog stick mapped to /dev/input/event3.

This setup somewhat works with SDL1 as it doesn't have the nice gamepad API and games didn't mind using keyboard keys with a button-less joystick. For SDL2 however, I would like the buttons and sticks to appear as a single gamepad since many games and apps won't work without it.

I see this as divisible into two tasks:
1. Gamepad controller map should be able to map buttons from keyboard keys;
2. Gamepad controller map should be able to map from more than one SDL_Joystick / SDL_Keyboard.

I know this is a big change, what do you think of it? Is that something that could be supported upstream?
Comment 1 Sam Lantinga 2020-01-19 19:19:22 UTC
Merging more than one physical device would be useful for the Nintendo Switch JoyCon controllers as well.

I don't have time to work on this, but it's definitely something that would be appreciated if you want to contribute.