21 #include "../SDL_internal.h" 32 #if !SDL_EVENTS_DISABLED 33 #include "../events/SDL_events_c.h" 36 #if defined(__ANDROID__) 41 #define SDL_CONTROLLER_PLATFORM_FIELD "platform:" 89 typedef struct _ControllerMapping_t
95 struct _ControllerMapping_t *
next;
139 if (hint && *hint ==
'@') {
161 if (entries ==
NULL) {
202 if (num_events <= 0) {
212 for (i = 0; i < num_events; ++
i) {
248 for (i = 0; i < gamecontroller->num_bindings; ++
i) {
253 if (value >= binding->
input.
axis.axis_min &&
259 if (value >= binding->
input.
axis.axis_max &&
268 if (last_match && (!match || !
HasSameOutput(last_match, match))) {
291 gamecontroller->last_match_axis[
axis] = match;
298 for (i = 0; i < gamecontroller->num_bindings; ++
i) {
316 Uint8 last_mask = gamecontroller->last_hat_mask[hat];
319 for (i = 0; i < gamecontroller->num_bindings; ++
i) {
322 if ((changed_mask & binding->
input.
hat.hat_mask) != 0) {
323 if (value & binding->
input.
hat.hat_mask) {
335 gamecontroller->last_hat_mask[hat] =
value;
343 switch(event->
type) {
347 while (controllerlist) {
348 if (controllerlist->joystick->instance_id == event->
jaxis.
which) {
352 controllerlist = controllerlist->next;
360 while (controllerlist) {
361 if (controllerlist->joystick->instance_id == event->
jbutton.
which) {
365 controllerlist = controllerlist->next;
372 while (controllerlist) {
373 if (controllerlist->joystick->instance_id == event->
jhat.
which) {
377 controllerlist = controllerlist->next;
394 while (controllerlist) {
395 if (controllerlist->joystick->instance_id == event->
jdevice.
which) {
405 controllerlist = controllerlist->next;
422 while (pSupportedController) {
423 if (
SDL_memcmp(guid, &pSupportedController->
guid,
sizeof(*guid)) == 0) {
424 return pSupportedController;
426 pSupportedController = pSupportedController->
next;
448 if (pchString && (*pchString ==
'+' || *pchString ==
'-')) {
452 if (!pchString || !pchString[0]) {
499 if (!pchString || !pchString[0])
529 char half_axis_input = 0;
530 char half_axis_output = 0;
532 if (*szGameButton ==
'+' || *szGameButton ==
'-') {
533 half_axis_output = *szGameButton++;
545 if (half_axis_output ==
'+') {
548 }
else if (half_axis_output ==
'-') {
560 SDL_SetError(
"Unexpected controller element %s", szGameButton);
564 if (*szJoystickButton ==
'+' || *szJoystickButton ==
'-') {
565 half_axis_input = *szJoystickButton++;
567 if (szJoystickButton[
SDL_strlen(szJoystickButton) - 1] ==
'~') {
571 if (szJoystickButton[0] ==
'a' &&
SDL_isdigit(szJoystickButton[1])) {
574 if (half_axis_input ==
'+') {
577 }
else if (half_axis_input ==
'-') {
589 }
else if (szJoystickButton[0] ==
'b' &&
SDL_isdigit(szJoystickButton[1])) {
592 }
else if (szJoystickButton[0] ==
'h' &&
SDL_isdigit(szJoystickButton[1]) &&
593 szJoystickButton[2] ==
'.' &&
SDL_isdigit(szJoystickButton[3])) {
594 int hat =
SDL_atoi(&szJoystickButton[1]);
600 SDL_SetError(
"Unexpected joystick element: %s", szJoystickButton);
604 ++gamecontroller->num_bindings;
606 if (!gamecontroller->bindings) {
607 gamecontroller->num_bindings = 0;
611 gamecontroller->bindings[gamecontroller->num_bindings - 1] = bind;
621 char szGameButton[20];
622 char szJoystickButton[20];
625 const char *pchPos = pchString;
630 while (pchPos && *pchPos) {
631 if (*pchPos ==
':') {
634 }
else if (*pchPos ==
' ') {
636 }
else if (*pchPos ==
',') {
643 }
else if (bGameButton) {
644 if (i >=
sizeof(szGameButton)) {
645 SDL_SetError(
"Button name too large: %s", szGameButton);
648 szGameButton[
i] = *pchPos;
651 if (i >=
sizeof(szJoystickButton)) {
652 SDL_SetError(
"Joystick button name too large: %s", szJoystickButton);
655 szJoystickButton[
i] = *pchPos;
672 gamecontroller->guid =
guid;
673 gamecontroller->name = pchName;
674 gamecontroller->num_bindings = 0;
675 SDL_memset(gamecontroller->last_match_axis, 0, gamecontroller->joystick->naxes *
sizeof(*gamecontroller->last_match_axis));
680 for (i = 0; i < gamecontroller->num_bindings; ++
i) {
686 if (binding->
input.
axis.axis < gamecontroller->joystick->naxes) {
687 gamecontroller->joystick->axes[binding->
input.
axis.axis].value =
700 const char *pFirstComma =
SDL_strchr(pMapping,
',');
702 char *pchGUID =
SDL_malloc(pFirstComma - pMapping + 1);
707 SDL_memcpy(pchGUID, pMapping, pFirstComma - pMapping);
708 pchGUID[pFirstComma - pMapping] =
'\0';
713 SDL_memcmp(&pchGUID[20],
"504944564944", 12) == 0) {
721 SDL_memcmp(&pchGUID[4],
"000000000000", 12) == 0 &&
722 SDL_memcmp(&pchGUID[20],
"000000000000", 12) == 0) {
739 const char *pFirstComma, *pSecondComma;
746 pSecondComma =
SDL_strchr(pFirstComma + 1,
',');
750 pchName =
SDL_malloc(pSecondComma - pFirstComma);
755 SDL_memcpy(pchName, pFirstComma + 1, pSecondComma - pFirstComma);
756 pchName[pSecondComma - pFirstComma - 1] = 0;
766 const char *pFirstComma, *pSecondComma;
772 pSecondComma =
SDL_strchr(pFirstComma + 1,
',');
785 while (gamecontrollerlist) {
786 if (!
SDL_memcmp(&gamecontrollerlist->guid, &pControllerMapping->
guid,
sizeof(pControllerMapping->
guid))) {
789 event.cdevice.which = gamecontrollerlist->joystick->instance_id;
796 gamecontrollerlist = gamecontrollerlist->next;
812 SDL_SetError(
"Couldn't parse name from %s", mappingString);
824 if (pControllerMapping) {
826 if (pControllerMapping->
priority <= priority) {
829 pControllerMapping->
name = pchName;
831 pControllerMapping->
mapping = pchMapping;
832 pControllerMapping->
priority = priority;
841 pControllerMapping =
SDL_malloc(
sizeof(*pControllerMapping));
842 if (!pControllerMapping) {
848 pControllerMapping->
guid = jGUID;
849 pControllerMapping->
name = pchName;
850 pControllerMapping->
mapping = pchMapping;
852 pControllerMapping->
priority = priority;
854 if (s_pSupportedControllers) {
858 for ( pPrevMapping = s_pSupportedControllers, pCurrMapping = pPrevMapping->
next;
860 pPrevMapping = pCurrMapping, pCurrMapping = pCurrMapping->
next ) {
863 pPrevMapping->
next = pControllerMapping;
865 s_pSupportedControllers = pControllerMapping;
869 return pControllerMapping;
880 #if defined(SDL_JOYSTICK_EMSCRIPTEN) 881 if (!mapping && s_pEmscriptenMapping) {
885 (
void) s_pEmscriptenMapping;
888 if (!mapping && name) {
889 if (
SDL_strstr(name,
"Xbox 360 Wireless Receiver")) {
893 "none,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
899 if (!mapping && name) {
924 #if SDL_JOYSTICK_XINPUT 925 if (!mapping && SDL_SYS_IsXInputGamepad_DeviceIndex(device_index)) {
929 #if defined(__ANDROID__) 930 if (!mapping && SDL_SYS_IsDPAD_DeviceIndex(device_index)) {
932 char mapping_string[1024];
933 SDL_snprintf(mapping_string,
sizeof(mapping_string),
"none,%s,a:b0,b:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,", name);
950 char *
buf, *line, *line_end, *tmp, *comma, line_platform[64];
951 size_t db_size, platform_len;
963 return SDL_SetError(
"Could not allocate space to read DB into memory");
981 while (line < buf + db_size) {
983 if (line_end !=
NULL) {
986 line_end = buf + db_size;
995 platform_len = comma - tmp + 1;
1006 line = line_end + 1;
1026 if (!mappingString) {
1032 return SDL_SetError(
"Couldn't parse GUID from %s", mappingString);
1044 if (!pControllerMapping) {
1051 if (is_xinput_mapping) {
1052 s_pXInputMapping = pControllerMapping;
1054 if (is_emscripten_mapping) {
1055 s_pEmscriptenMapping = pControllerMapping;
1076 int num_mappings = 0;
1079 for (mapping = s_pSupportedControllers;
mapping; mapping = mapping->
next) {
1085 return num_mappings;
1096 for (mapping = s_pSupportedControllers;
mapping; mapping = mapping->
next) {
1100 if (mapping_index == 0) {
1101 char *pMappingString;
1109 if (!pMappingString) {
1114 return pMappingString;
1127 char *pMappingString =
NULL;
1136 if (!pMappingString) {
1142 return pMappingString;
1151 if (!gamecontroller) {
1162 if (hint && hint[0]) {
1164 char *pUserMappings =
SDL_malloc(nchHints + 1);
1165 char *pTempMappings = pUserMappings;
1167 pUserMappings[nchHints] =
'\0';
1168 while (pUserMappings) {
1169 char *pchNewLine =
NULL;
1171 pchNewLine =
SDL_strchr(pUserMappings,
'\n');
1178 pUserMappings = pchNewLine + 1;
1180 pUserMappings =
NULL;
1194 #ifdef CONTROLLER_MAPPING_FILE 1195 #define STRING(X) SDL_STRINGIFY_ARG(X) 1196 return SDL_strlcpy(path, STRING(CONTROLLER_MAPPING_FILE), size) <
size;
1197 #elif defined(__ANDROID__) 1210 char szControllerMapPath[1024];
1212 const char *pMappingString =
NULL;
1214 while (pMappingString) {
1265 if (pSupportedController) {
1266 return pSupportedController->
name;
1279 if (pSupportedController) {
1292 if (pSupportedController) {
1319 #if defined(__LINUX__) 1320 bSteamVirtualGamepad = (vendor == 0x28DE && product == 0x11FF);
1321 #elif defined(__MACOSX__) 1322 bSteamVirtualGamepad = (
SDL_strncmp(name,
"GamePad-", 8) == 0);
1323 #elif defined(__WIN32__) 1327 if (bSteamVirtualGamepad) {
1333 for (i = 0; i < SDL_allowed_controllers.
num_entries; ++
i) {
1334 if (vidpid == SDL_allowed_controllers.
entries[i]) {
1340 for (i = 0; i < SDL_ignored_controllers.
num_entries; ++
i) {
1341 if (vidpid == SDL_ignored_controllers.
entries[i]) {
1356 SDL_GameController *
1359 SDL_GameController *gamecontroller;
1360 SDL_GameController *gamecontrollerlist;
1373 while (gamecontrollerlist) {
1375 gamecontroller = gamecontrollerlist;
1376 ++gamecontroller->ref_count;
1378 return (gamecontroller);
1380 gamecontrollerlist = gamecontrollerlist->next;
1385 if (!pSupportedController) {
1386 SDL_SetError(
"Couldn't find mapping for device (%d)", device_index);
1392 gamecontroller = (SDL_GameController *)
SDL_calloc(1,
sizeof(*gamecontroller));
1393 if (gamecontroller ==
NULL) {
1400 if (!gamecontroller->joystick) {
1406 if (gamecontroller->joystick->naxes) {
1408 if (!gamecontroller->last_match_axis) {
1416 if (gamecontroller->joystick->nhats) {
1417 gamecontroller->last_hat_mask = (
Uint8 *)
SDL_calloc(gamecontroller->joystick->nhats,
sizeof(*gamecontroller->last_hat_mask));
1418 if (!gamecontroller->last_hat_mask) {
1421 SDL_free(gamecontroller->last_match_axis);
1431 ++gamecontroller->ref_count;
1438 return (gamecontroller);
1459 if (!gamecontroller)
1462 for (i = 0; i < gamecontroller->num_bindings; ++
i) {
1472 valid_input_range = (value >= binding->
input.
axis.axis_min && value <= binding->
input.
axis.axis_max);
1474 valid_input_range = (value >= binding->
input.
axis.axis_max && value <= binding->
input.
axis.axis_min);
1476 if (valid_input_range) {
1478 float normalized_value = (float)(value - binding->
input.
axis.axis_min) / (binding->
input.
axis.axis_max - binding->
input.
axis.axis_min);
1489 if (hat_mask & binding->
input.
hat.hat_mask) {
1495 valid_output_range = (value >= binding->
output.
axis.axis_min && value <= binding->
output.
axis.axis_max);
1497 valid_output_range = (value >= binding->
output.
axis.axis_max && value <= binding->
output.
axis.axis_min);
1500 if (value != 0 && valid_output_range) {
1516 if (!gamecontroller)
1519 for (i = 0; i < gamecontroller->num_bindings; ++
i) {
1528 valid_input_range = (value >= binding->
input.
axis.axis_min && value <= binding->
input.
axis.axis_max);
1529 if (valid_input_range) {
1533 valid_input_range = (value >= binding->
input.
axis.axis_max && value <= binding->
input.
axis.axis_min);
1534 if (valid_input_range) {
1552 if (!gamecontroller)
1555 return gamecontroller->name;
1583 if (!gamecontroller)
1594 if (!gamecontroller)
1597 return gamecontroller->joystick;
1604 SDL_GameController *
1607 SDL_GameController *gamecontroller;
1611 while (gamecontroller) {
1612 if (gamecontroller->joystick->instance_id == joyid) {
1614 return gamecontroller;
1616 gamecontroller = gamecontroller->next;
1635 for (i = 0; i < gamecontroller->num_bindings; ++
i) {
1667 for (i = 0; i < gamecontroller->num_bindings; ++
i) {
1689 SDL_GameController *gamecontrollerlist, *gamecontrollerlistprev;
1691 if (!gamecontroller)
1697 if (--gamecontroller->ref_count > 0) {
1705 gamecontrollerlistprev =
NULL;
1706 while (gamecontrollerlist) {
1707 if (gamecontroller == gamecontrollerlist) {
1708 if (gamecontrollerlistprev) {
1710 gamecontrollerlistprev->next = gamecontrollerlist->next;
1716 gamecontrollerlistprev = gamecontrollerlist;
1717 gamecontrollerlist = gamecontrollerlist->next;
1720 SDL_free(gamecontroller->bindings);
1721 SDL_free(gamecontroller->last_match_axis);
1722 SDL_free(gamecontroller->last_hat_mask);
1748 while (s_pSupportedControllers) {
1750 s_pSupportedControllers = s_pSupportedControllers->
next;
1763 if (SDL_allowed_controllers.
entries) {
1767 if (SDL_ignored_controllers.
entries) {
1783 #if !SDL_EVENTS_DISABLED 1787 event.caxis.which = gamecontroller->joystick->instance_id;
1788 event.caxis.axis =
axis;
1789 event.caxis.value =
value;
1804 #if !SDL_EVENTS_DISABLED 1825 #if !SDL_EVENTS_DISABLED 1827 event.cbutton.which = gamecontroller->joystick->instance_id;
1828 event.cbutton.button =
button;
1829 event.cbutton.state =
state;
1842 #if SDL_EVENTS_DISABLED 1845 const Uint32 event_list[] = {
static const char * map_StringForControllerAxis[]
char * SDL_GameControllerMapping(SDL_GameController *gamecontroller)
union SDL_ExtendedGameControllerBind::@24 output
#define SDL_DelEventWatch
Uint16 SDL_GameControllerGetProduct(SDL_GameController *gamecontroller)
SDL_GameControllerBindType
#define SDL_CONTROLLER_PLATFORM_FIELD
#define SDL_JoystickGetButton
SDL_GameControllerButton SDL_GameControllerGetButtonFromString(const char *pchString)
SDL_JoyDeviceEvent jdevice
#define SDL_UnlockJoysticks
#define SDL_JoystickClose
#define MAKE_VIDPID(VID, PID)
static int SDL_GameControllerEventWatcher(void *userdata, SDL_Event *event)
static void HandleJoystickHat(SDL_GameController *gamecontroller, int hat, Uint8 value)
#define SDL_JoystickGetVendor
void SDL_GameControllerQuitMappings(void)
SDL_ControllerDeviceEvent cdevice
int SDL_GameControllerInitMappings(void)
SDL_GameControllerButtonBind SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)
SDL_ControllerMappingPriority priority
SDL_JoyButtonEvent jbutton
struct _ControllerMapping_t * next
static void ResetOutput(SDL_GameController *gamecontroller, SDL_ExtendedGameControllerBind *bind)
static SDL_bool SDL_GetControllerMappingFilePath(char *path, size_t size)
static void UpdateEventsForDeviceRemoval()
char * SDL_GameControllerMappingForIndex(int mapping_index)
Uint16 SDL_GameControllerGetVendor(SDL_GameController *gamecontroller)
Sint16 SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)
SDL_GameControllerAxis SDL_GameControllerGetAxisFromString(const char *pchString)
#define SDL_JoystickNameForIndex
static SDL_vidpid_list SDL_ignored_controllers
static SDL_Event events[EVENT_BUF_SIZE]
SDL_GameControllerBindType inputType
static ControllerMapping_t * SDL_PrivateGetControllerMappingForNameAndGUID(const char *name, SDL_JoystickGUID guid)
#define SDL_RWread(ctx, ptr, size, n)
#define SDL_InvalidParamError(param)
static void SDL_GameControllerLoadHints()
static ControllerMapping_t * s_pEmscriptenMapping
SDL_ExtendedGameControllerBind * bindings
#define SDL_JoystickGetGUIDString
#define SDL_JoystickGetProduct
#define SDL_JoystickGetHat
GLuint const GLchar * name
SDL_GameControllerAxis axis
struct _SDL_GameController * next
#define SDL_JoystickGetDeviceGUID
SDL_GameController * SDL_GameControllerFromInstanceID(SDL_JoystickID joyid)
#define SDL_GetHintBoolean
static ControllerMapping_t * SDL_PrivateGetControllerMappingForGUID(SDL_JoystickGUID *guid)
static int SDL_PrivateGameControllerAddMapping(const char *mappingString, SDL_ControllerMappingPriority priority)
#define SDL_JOYSTICK_AXIS_MIN
void SDL_GameControllerClose(SDL_GameController *gamecontroller)
union SDL_ExtendedGameControllerBind::@23 input
#define SDL_JOYSTICK_AXIS_MAX
GLenum GLenum GLenum input
#define SDL_GetEventState(type)
static SDL_GameController * SDL_gamecontrollers
static ControllerMapping_t * s_pSupportedControllers
int SDL_GameControllerEventState(int state)
void SDL_GameControllerQuit(void)
int SDL_GameControllerAddMapping(const char *mappingString)
#define SDL_stack_alloc(type, count)
const char * SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis)
const char * SDL_GameControllerName(SDL_GameController *gamecontroller)
static void SDL_PrivateGameControllerParseControllerConfigString(SDL_GameController *gamecontroller, const char *pchString)
SDL_GameControllerBindType outputType
SDL_ExtendedGameControllerBind ** last_match_axis
static SDL_bool HasSameOutput(SDL_ExtendedGameControllerBind *a, SDL_ExtendedGameControllerBind *b)
Uint16 SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller)
SDL_bool SDL_ShouldIgnoreGameController(const char *name, SDL_JoystickGUID guid)
GLsizei const GLfloat * value
#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT
SDL_ControllerMappingPriority
static int SDL_PrivateGameControllerButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button, Uint8 state)
#define SDL_JoystickGetAttached
static const char * map_StringForControllerButton[]
void SDL_GameControllerUpdate(void)
GLenum GLuint GLenum GLsizei const GLchar * buf
static ControllerMapping_t * SDL_PrivateGetControllerMapping(int device_index)
static char * SDL_PrivateGetControllerMappingFromMappingString(const char *pMapping)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
SDL_bool SDL_IsGameControllerNameAndGUID(const char *name, SDL_JoystickGUID guid)
static void SDL_PrivateGameControllerParseElement(SDL_GameController *gamecontroller, const char *szGameButton, const char *szJoystickButton)
SDL_GameController * SDL_GameControllerOpen(int device_index)
static char * SDL_PrivateGetControllerGUIDFromMappingString(const char *pMapping)
static void HandleJoystickButton(SDL_GameController *gamecontroller, int button, Uint8 state)
static void SDL_PrivateGameControllerRefreshMapping(ControllerMapping_t *pControllerMapping)
SDL_bool SDL_IsGameController(int device_index)
#define SDL_OutOfMemory()
static char * SDL_PrivateGetControllerNameFromMappingString(const char *pMapping)
static void SDL_GameControllerIgnoreDevicesExceptChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
static const char * s_ControllerMappings[]
#define SDL_JoystickUpdate
static SDL_JoystickGUID s_zeroGUID
SDL_GameControllerButtonBind SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)
static SDL_vidpid_list SDL_allowed_controllers
#define SDL_JoystickGetAxis
void SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version)
#define SDL_AddEventWatch
SDL_Joystick * SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller)
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 void
#define SDL_AddHintCallback
static ControllerMapping_t * s_pXInputMapping
#define SDL_DelHintCallback
SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index)
int SDL_GameControllerNumMappings(void)
#define SDL_arraysize(array)
GLenum GLenum GLenum GLenum mapping
#define SDL_HINT_GAMECONTROLLERCONFIG
A variable that lets you manually hint extra gamecontroller db entries.
GLsizei const GLchar *const * path
SDL_GameControllerButton button
#define SDL_GameControllerAddMappingsFromFile(file)
static void SDL_PrivateLoadButtonMapping(SDL_GameController *gamecontroller, SDL_JoystickGUID guid, const char *pchName, const char *pchMapping)
#define SDL_JoystickGetProductVersion
#define SDL_stack_free(data)
GLboolean GLboolean GLboolean GLboolean a
static void SDL_LoadVIDPIDListFromHint(const char *hint, SDL_vidpid_list *list)
int SDL_GameControllerAddMappingsFromRW(SDL_RWops *rw, int freerw)
int SDL_GameControllerInit(void)
const char * SDL_GameControllerGetStringForButton(SDL_GameControllerButton axis)
char * SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid)
#define SDL_LockJoysticks
static ControllerMapping_t * SDL_PrivateAddMappingForGUID(SDL_JoystickGUID jGUID, const char *mappingString, SDL_bool *existing, SDL_ControllerMappingPriority priority)
Uint8 SDL_GameControllerGetButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)
GLboolean GLboolean GLboolean b
#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES
#define SDL_AndroidGetInternalStoragePath
static int SDL_PrivateGameControllerAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis, Sint16 value)
#define SDL_LoadFile(file, datasize)
static void HandleJoystickAxis(SDL_GameController *gamecontroller, int axis, int value)
SDL_bool SDL_GameControllerGetAttached(SDL_GameController *gamecontroller)
#define SDL_JoystickGetGUIDFromString
static void SDL_GameControllerIgnoreDevicesChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
const char * SDL_GameControllerNameForIndex(int device_index)