From d4ab609121ee6e687bc3d3a7e80244b3b26d1164 Mon Sep 17 00:00:00 2001 From: Susko3 Date: Sat, 25 Nov 2023 00:17:06 +0100 Subject: [PATCH] Add SDL3 function name (#719) * Add SDL3 function name See https://github.com/libsdl-org/SDL/blob/f40f272107ff9e8cfe96f3a531944e7cc411cee6/test/testcontroller.c#L1945 --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9ef6b56..0c9584f 100644 --- a/README.md +++ b/README.md @@ -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, ```