SDL_HINT_TV_REMOTE_AS_JOYSTICK should only affect Siri Remotes on Apple TV
Other gamepads like the iBuffalo Classic USB Gamepad will not have a standard profile, but shouldn't be ignored when this hint is enabled.
This commit is contained in:
@@ -407,6 +407,11 @@ static BOOL IOS_AddMFIJoystickDevice(SDL_JoystickDeviceItem *device, GCControlle
|
|||||||
#endif
|
#endif
|
||||||
CheckControllerSiriRemote(controller, &device->is_siri_remote);
|
CheckControllerSiriRemote(controller, &device->is_siri_remote);
|
||||||
|
|
||||||
|
if (device->is_siri_remote && !SDL_GetHintBoolean(SDL_HINT_TV_REMOTE_AS_JOYSTICK, SDL_TRUE)) {
|
||||||
|
/* Ignore remotes, they'll be handled as keyboard input */
|
||||||
|
return SDL_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_PHYSICAL_INPUT_PROFILE
|
#ifdef ENABLE_PHYSICAL_INPUT_PROFILE
|
||||||
if ([controller respondsToSelector:@selector(physicalInputProfile)]) {
|
if ([controller respondsToSelector:@selector(physicalInputProfile)]) {
|
||||||
if (controller.physicalInputProfile.buttons[GCInputDualShockTouchpadButton] != nil) {
|
if (controller.physicalInputProfile.buttons[GCInputDualShockTouchpadButton] != nil) {
|
||||||
@@ -718,15 +723,6 @@ static void IOS_AddJoystickDevice(GCController *controller, SDL_bool acceleromet
|
|||||||
{
|
{
|
||||||
SDL_JoystickDeviceItem *device = deviceList;
|
SDL_JoystickDeviceItem *device = deviceList;
|
||||||
|
|
||||||
#if TARGET_OS_TV
|
|
||||||
if (!SDL_GetHintBoolean(SDL_HINT_TV_REMOTE_AS_JOYSTICK, SDL_TRUE)) {
|
|
||||||
/* Ignore devices that aren't actually controllers (e.g. remotes), they'll be handled as keyboard input */
|
|
||||||
if (controller && !controller.extendedGamepad && !controller.gamepad && controller.microGamepad) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (device != NULL) {
|
while (device != NULL) {
|
||||||
if (device->controller == controller) {
|
if (device->controller == controller) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user