2017-08-28 23:41:23 -04:00
## SDL_GameControllerDB
2013-11-27 17:20:34 -03:00
2017-10-07 12:25:10 -04:00
[](https://travis-ci.org/p-groarke/SDL_GameControllerDB)
2013-11-27 17:20:34 -03:00
2014-01-10 15:15:57 -03:00
A community source database of game controller mappings to be used with SDL2 Game Controller functionality.
2013-11-27 17:20:34 -03:00
2017-08-28 23:41:23 -04:00
#### Usage:
2013-11-27 17:20:34 -03:00
Download gamecontrollerdb.txt, place it in your app's directory and load with:
```
SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt");
```
2017-08-28 23:41:23 -04:00
#### Creating new mappings:
2013-12-02 19:55:59 -03:00
2017-10-07 20:12:35 -04:00
To create new mappings, you can use the controllermap utility provided with SDL2.
You can also use Steam's Big Picture mode. Configure your joystick and then look in config/config.vdf in your Steam installation directory for the SDL_GamepadBind entry.
2013-11-27 17:20:34 -03:00
2017-08-28 23:41:23 -04:00
#### Checking your mappings:
2016-07-06 04:17:47 +05:30
You need to have python3 installed. Run
```
python3 check.py gamecontrollerdb.txt
```
2017-10-07 20:12:35 -04:00
If no errors were generated, the database file will be sorted. You can now send a Pull Request.
2017-08-28 23:41:23 -04:00
#### References:
2013-11-27 17:20:34 -03:00
* [SDL2 ](http://www.libsdl.org )
2016-07-06 04:17:47 +05:30
* [SDL_GameControllerAddMappingsFromFile ](http://wiki.libsdl.org/SDL_GameControllerAddMappingsFromFile )