A curated and automatically updated game controller mapping database for Linux platforms, based on the SDL_GameControllerDB project.
This repository provides a filtered and enhanced version of the SDL Game Controller Database specifically optimized for Linux gaming. It automatically monitors the upstream repository for updates and maintains a clean, Linux-focused database with custom controller mappings.
- 🐧 Linux-focused: Filtered to include only Linux-compatible controller mappings
- 🔄 Auto-updated: Daily automated checks for upstream changes
- 🎮 Custom mappings: Includes additional controller configurations for specialized hardware
- 🧹 Duplicate-free: Automatically removes duplicate entries by GUID
- 📊 Clean format: Excludes Windows, macOS, Android, and iOS mappings
gamecontrollerdb.txt
- The main processed database file ready for useadd_gamecontrollerdb.txt
- Custom controller mappings added to the database.github/workflows/gamecontrollerdb.yaml
- Automated workflow configuration
The database includes mappings for a wide variety of controllers including:
- Xbox controllers (360, One, Series X/S)
- PlayStation controllers (PS3, PS4, PS5)
- Nintendo controllers (Pro Controller, Wii Remote)
- Generic USB gamepads
- Arcade controllers (X-Arcade, IPAC)
- Racing wheels (Logitech G25/G27/G29, Thrustmaster)
- Retro gaming controllers (8BitDo, RetroFlag)
- Handheld device controllers (Anbernic, PiBoy DMG)
Download the gamecontrollerdb.txt
file directly from this repository and place it in your application's directory.
#include <SDL2/SDL.h>
int main() {
SDL_Init(SDL_INIT_GAMECONTROLLER);
// Load the controller database
SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt");
// Your game code here
SDL_Quit();
return 0;
}
The repository uses GitHub Actions to automatically:
- Monitor the upstream SDL_GameControllerDB repository daily
- Filter out non-Linux platforms (Windows, macOS, Android, iOS)
- Merge custom controller mappings from
add_gamecontrollerdb.txt
- Deduplicate entries by controller GUID
- Commit and push updates automatically
- ⏰ Scheduled execution: Runs daily at midnight UTC
- 🔧 Manual trigger: Can be triggered manually via GitHub Actions
- 📝 Automated commits: Updates are committed with timestamps
- 🧹 Cleanup: Temporary files are automatically removed
To add support for a new controller:
- Fork this repository
- Add your controller mapping to
add_gamecontrollerdb.txt
- Follow the SDL mapping format:
GUID,Controller Name,button mappings,platform:Linux,
- Submit a pull request
Each controller mapping follows this structure:
GUID,Name,a:button,b:button,x:button,y:button,...,platform:Linux,
Example:
030000005e0400008e02000021010000,Microsoft X-Box 360 pad,a:b0,b:b1,x:b2,y:b3,back:b6,start:b7,guide:b8,leftshoulder:b4,rightshoulder:b5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,platform:Linux,
This database is compatible with:
- SDL2 version 2.0.0 and above
- Games using SDL2 for input handling
- Emulators (RetroArch, MAME, etc.)
- Game engines with SDL2 integration
This project follows the same licensing as the original SDL_GameControllerDB project. Controller mappings are community-contributed and freely available for use in both commercial and non-commercial projects.
- 🐛 Issues: Report problems via GitHub Issues
- 💬 Discussions: Use GitHub Discussions for questions
- 📖 Documentation: Check SDL2 documentation for mapping details
- SDL_GameControllerDB - Original database
- SDL2 - Simple DirectMedia Layer