-
-
Notifications
You must be signed in to change notification settings - Fork 23.3k
Handle SDL joypad events for connected controllers on game startup (on Windows and Linux) #109750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle SDL joypad events for connected controllers on game startup (on Windows and Linux) #109750
Conversation
Make sure that SDL events are processed when the SDL joypad input driver is initialized, this will allow it to register the connected controllers when a game starts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it on macOS, I can reproduce the issue, but this change doesn't fix it.
Thank you for testing, bruvzg! I will try to reproduce the issue tomorrow on macOS myself and I will try to fix it! |
Most likely, it needs a system event pump ( |
Tested on Linux (CachyOS) and it fixes the bug. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me.
Thank you for testing, spookto and Calinou! |
@naturally-intelligent Sorry for bothering you, may I ask if this change fixes your issue? |
Seems like in case of macOS it is detected after 5-10 main event loop iterations, so not sure if it's even fixable (or should be considered a bug at all). |
May I ask if the issue is also reproducible in Godot 4.4 on macOS? |
Yes, it is the same 4.4.1. |
I see, thank you for testing! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested in on Linux and Windows, in both cases issue is reproducible and fixed.
Thanks! |
Thank you! :D |
With this merge,, my gampad is not working, and with following message:
Gamepad works again after revert it. |
Oops, I forgot about DInput controllers 😅 I will try to fix the problem |
Fix works for me (as of beta7) |
Fixes #109717
Make sure that SDL events are processed when the SDL joypad input driver is initialized, this will allow it to register the connected controllers when the game starts. The registered controllers will then show up in
Input.get_connected_joypads()
.Before this PR
After this PR
I tested this PR on Windows and I thought this would fix it on all platforms 😅
TODO: