Skip to content

Commit

Permalink
Add SDL3 function name (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
Susko3 authored Nov 24, 2023
1 parent e6e422a commit d4ab609
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@ A community sourced database of game controller mappings to be used with SDL2 Ga
# Usage
Download gamecontrollerdb.txt, place it in your app's directory and load it.

For example :
```
SDL2:
```c
SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt");
```
The database is compatible with SDL v2.0.10 and newer. Older SDL versions are no longer supported.
SDL3:
```c
SDL_AddGamepadMappingsFromFile("gamecontrollerdb.txt");
```

The database is compatible with SDL v2.0.10 and newer.

## Create New Mappings
A mapping looks like this :
A mapping looks like this:
```
030000004c050000c405000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
```
Expand Down

0 comments on commit d4ab609

Please sign in to comment.