mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Use the real controller name for game controllers on iOS and Apple TV
This commit is contained in:
parent
4f695bc5e5
commit
003c0dce9c
@ -1263,7 +1263,11 @@ SDL_GameControllerNameForIndex(int device_index)
|
||||
{
|
||||
ControllerMapping_t *pSupportedController = SDL_PrivateGetControllerMapping(device_index);
|
||||
if (pSupportedController) {
|
||||
return pSupportedController->name;
|
||||
if (SDL_strcmp(pSupportedController->name, "*") == 0) {
|
||||
return SDL_JoystickNameForIndex(device_index);
|
||||
} else {
|
||||
return pSupportedController->name;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@ -1552,7 +1556,11 @@ SDL_GameControllerName(SDL_GameController * gamecontroller)
|
||||
if (!gamecontroller)
|
||||
return NULL;
|
||||
|
||||
return gamecontroller->name;
|
||||
if (SDL_strcmp(gamecontroller->name, "*") == 0) {
|
||||
return SDL_JoystickName(SDL_GameControllerGetJoystick(gamecontroller));
|
||||
} else {
|
||||
return gamecontroller->name;
|
||||
}
|
||||
}
|
||||
|
||||
Uint16
|
||||
|
@ -218,8 +218,8 @@ static const char *s_ControllerMappings [] =
|
||||
"34356136633366613530316338376136,Xbox Wireless Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b3,leftstick:b15,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a3,righty:a4,x:b17,y:b2,",
|
||||
#endif
|
||||
#if defined(SDL_JOYSTICK_MFI)
|
||||
"4d466947616d65706164010000000000,MFi Extended Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,",
|
||||
"4d466947616d65706164020000000000,MFi Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b6,x:b2,y:b3,",
|
||||
"4d466947616d65706164010000000000,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,",
|
||||
"4d466947616d65706164020000000000,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b6,x:b2,y:b3,",
|
||||
"4d466947616d65706164030000000000,Remote,a:b0,b:b2,leftx:a0,lefty:a1,",
|
||||
"05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,",
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user