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 2426

Summary: [PATCH] Add gamecontrollerdb entry for Logitech Dual Action Gamepad (Linux)
Product: SDL Reporter: Sebastian Keller <sebastian-keller>
Component: joystickAssignee: Gabriel Jacobo <gabomdq>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.1   
Hardware: x86_64   
OS: Linux   
Attachments: Add support for Logitech Dual Action Gamepad

Description Sebastian Keller 2014-03-03 14:26:27 UTC
Created attachment 1583 [details]
Add support for Logitech Dual Action Gamepad

This mapping is based on the "F710 (DINPUT)" one with a modified USB ID and name. I've also cleaned up the name since originally it says "Logitech Logitech Dual Action". So if this string is used anywhere for device matching rather than just as a string in the UI, I can submit a different patch with the original name in place.

I have verified this mapping works using testgamecontroller and some games. The layout matches the xbox 360 one as much as possible.
Comment 1 Gabriel Jacobo 2014-04-18 17:42:59 UTC
We already have a mapping for this controller here: https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt

AFAICT it's the same one you are providing, let me know if that doesn't work correctly for you (if you place gamecontrollerdb.txt in the same folder as testgamecontroller it will be picked up automatically).

Thanks!
Comment 2 Sebastian Keller 2014-04-18 19:03:46 UTC
Thanks for your reply but now I'm confused. Is this file supposed to come with SDL and if so why is it not in the SDL repository? And why does SDL_gamecontrollerdb.h still exist is being updated then? Also none of the Humble Bundle games that use SDL2 (that I tested so far) seem to come with that file and they didn't work until I either configured the controller using the environment variable or used the patched version of SDL2.

I have run testgamecontroller with this file now and it works but I fail to see how this helps with the out of the box experience. You would need to know that you are supposed to download that file and I did not find any documentation about this when I was trying to get my controller working. Or is there maybe anything wrong with my setup preventing me from getting this file automatically?
Comment 3 Gabriel Jacobo 2014-04-18 19:21:26 UTC
That file is where we keep a crowd sourced database of "unofficial" mappings.

Each game that uses SDL needs to allow you to load these mappings. The case can be made for enabling this by default, or via a hint (SDL_GAMECONTROLLERDB=gamecontrollerdb.txt). Let's see what Sam says about it.
Comment 4 Sebastian Keller 2014-04-18 19:35:31 UTC
That still would not fix the out of the box experience unless the file was somehow included in SDL. Maybe a script could be used to generate SDL_gamecontrollerdb.h from the file in your repository for each new release of SDL. That way SDL would receive mapping updates somewhat regularly, it would work out of the box and users would still be able to manually update or override the mappings (assuming loading gamecontrollerdb.txt was enabled by default).