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 - Support for composite gamepads
Summary: Support for composite gamepads
Status: WAITING
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.0
Hardware: All Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-18 19:52 UTC by Paul Cercueil
Modified: 2020-06-20 21:32 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.