Skip to content

Conversation

@Nintorch
Copy link
Contributor

@Nintorch Nintorch commented Dec 24, 2025

Follow-up to #106218

I decided to split #109645 into several smaller PRs, starting with iOS and visionOS.
This PR adds support for SDL3 joystick input driver for the rest of the supported Apple platforms.

Also, it would be nice if someone could test if Input.has_joy_light() and Input.set_joy_light() work on iOS and visionOS with this PR. :D
I think they're supposed to work since JoystickSetLED function is implemented in the MFI joystick driver and a check for iOS version is included inside:

static bool IOS_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue)
{
@autoreleasepool {
SDL_JoystickDeviceItem *device = joystick->hwdata;
if (device == NULL) {
return SDL_SetError("Controller is no longer connected");
}
if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) {
GCController *controller = device->controller;
GCDeviceLight *light = controller.light;
if (light) {
light.color = [[GCColor alloc] initWithRed:(float)red / 255.0f
green:(float)green / 255.0f
blue:(float)blue / 255.0f];
return true;
}
}
}
return SDL_Unsupported();
}

@Nintorch Nintorch requested review from a team as code owners December 24, 2025 12:39
@Nintorch Nintorch changed the title Add support for SDL joystick input driver for iOS and visionOS Add support for SDL3 joystick input driver for iOS and visionOS Dec 24, 2025
@Chaosus Chaosus added this to the 4.7 milestone Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants