Add support for SDL3 joystick input driver for iOS#114316
Add support for SDL3 joystick input driver for iOS#114316Repiteo merged 1 commit intogodotengine:masterfrom
Conversation
b738d7b to
d94fc4d
Compare
d94fc4d to
95d5fff
Compare
95d5fff to
b8a7a46
Compare
|
I only have a Mac mini. I can't test it on iOS/VisionOS. CC @godotengine/ios |
|
Tried it on iOS (10.gen iPad, iOS 26.3), and no controllers are detected (tested with Dual Sense and Xbox One controllers, both BT and wired connection). |
|
Thank you for your review, bruvzg! I will try to fix this issue! |
|
Relevant part from the log: |
Some noted:
|
|
Simply commenting |
|
With the following patch (and rebase to master): diff --git a/thirdparty/sdl/include/SDL3/SDL_main.h b/thirdparty/sdl/include/SDL3/SDL_main.h
index 905d78e964..46e20445aa 100644
--- a/thirdparty/sdl/include/SDL3/SDL_main.h
+++ b/thirdparty/sdl/include/SDL3/SDL_main.h
@@ -174,7 +174,7 @@
See src/video/uikit/SDL_uikitappdelegate.m for more details.
*/
- #define SDL_MAIN_NEEDED
+ // #define SDL_MAIN_NEEDED
#elif defined(SDL_PLATFORM_ANDROID)
/* On Android SDL provides a Java class in SDLActivity.java that is the
|
|
Thank you very much! I will include your fix in the PR later today! |
No, |
|
Does it return false in _ready() or in _process() too? |
|
Only checked it with |
|
I see, thank you for testing! It seems to me like an issue with SDL, I will try to report the issue in their repository soon. |
|
It seems it only supports |
|
I'm not entirely sure SDL (and this PR) supports controllers for visionOS, so I think it's probably a good idea to mark it as only for iOS for now. |
OS API should be the same, but I have not way to test it. |
b8a7a46 to
73fcc0d
Compare
I defined godot/thirdparty/sdl/include/SDL3/SDL_main.h Lines 145 to 178 in 8db94f7 |
bruvzg
left a comment
There was a problem hiding this comment.
Retested all features, everything seems to work (including Input.get_joy_gyroscope()). Code looks good.
|
Thanks! |
Follow-up to #106218
I decided to split #109645 into several smaller PRs, starting with iOS
and visionOS.(EDIT: not entirely sure this PR supports 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()andInput.set_joy_light()work on iOSand visionOSwith this PR. :DI think they're supposed to work since
JoystickSetLEDfunction is implemented in the MFI joystick driver and a check for iOS version is included inside:godot/thirdparty/sdl/joystick/apple/SDL_mfijoystick.m
Lines 1452 to 1473 in 63227bb
TODO:
Report SDL not detecting controller motion sensors on iOSInput.has_joy_motion_sensors()if only one of the motion sensors is availableInput.get_joy_accelerometer()andInput.get_joy_gravity()being unsupported on iOS due to OS limitations.