.\" This manpage content is licensed under Creative Commons .\" Attribution 4.0 International (CC BY 4.0) .\" https://creativecommons.org/licenses/by/4.0/ .\" This manpage was generated from SDL's wiki page for SDL_AddGamepadMapping: .\" https://wiki.libsdl.org/SDL_AddGamepadMapping .\" Generated with SDL/build-scripts/wikiheaders.pl .\" revision SDL-3.1.0 .\" Please report issues in this manpage's content at: .\" https://github.com/libsdl-org/sdlwiki/issues/new .\" Please report issues in the generation of this manpage from the wiki at: .\" https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20SDL_AddGamepadMapping .\" SDL can be found at https://libsdl.org/ .de URL \$2 \(laURL: \$1 \(ra\$3 .. .if \n[.g] .mso www.tmac .TH SDL_AddGamepadMapping 3 "SDL 3.1.0" "SDL" "SDL3 FUNCTIONS" .SH NAME SDL_AddGamepadMapping \- Add support for gamepads that SDL is unaware of or change the binding of an existing gamepad\[char46] .SH SYNOPSIS .nf .B #include \(dqSDL3/SDL.h\(dq .PP .BI "int SDL_AddGamepadMapping(const char *mapping); .fi .SH DESCRIPTION The mapping string has the format "GUID,name,mapping", where GUID is the string value from .BR SDL_GetJoystickGUIDString (), name is the human readable string for the device and mappings are gamepad mappings to joystick ones\[char46] Under Windows there is a reserved GUID of "xinput" that covers all XInput devices\[char46] The mapping format for joystick is: - .BR bX : a joystick button, index X - .BR hX\[char46]Y : hat X with value Y - .BR aX : axis X of the joystick Buttons can be used as a gamepad axes and vice versa\[char46] This string shows an example of a valid mapping for a gamepad: .BR .BR c "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0\[char46]1,dpleft:h0\[char46]8,dpdown:h0\[char46]4,dpright:h0\[char46]2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7" .BR .SH FUNCTION PARAMETERS .TP .I mapping the mapping string .SH RETURN VALUE Returns 1 if a new mapping is added, 0 if an existing mapping is updated, -1 on error; call .BR SDL_GetError () for more information\[char46] .SH AVAILABILITY This function is available since SDL 3\[char46]0\[char46]0\[char46] .SH SEE ALSO .BR SDL_GetGamepadMapping (3), .BR SDL_GetGamepadMappingForGUID (3)