-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[rcore] Gamepad no longer detected after removing and adding when using SDL2 backend #4722
Comments
@ZachIsAGardner I'm afraid the information provided is not enough to review this issue. Did you try debugging related code on raylib? Afaik, it calls directly SDL2 functionality, there is no magic in raylib that could generate that issue... |
I put trace logs in rcore_desktop_sdl.c... Here.
And here.
This gif might help show the problem. Here I am plugging and unplugging my controller a few times. The I am very new to C so it's a little difficult for me to look into why that's happening. |
I also received an email notification with a reply from @asdqwe, I'm not sure what happened to their post in this thread, but it sounds like they were onto something...
|
@ZachIsAGardner Yeah, sorry, I removed the post because after looking at what I'd have to change to fix this I just gave up. The SDL2 doc mentions The problem is that raylib is using the Since I don't use |
EDIT: The last update of the #4724 should (hopefully) fix this issue completely. |
Issue description
I am using SDL2 as my backend for my project, because GLFW doesn't support controller rumble. I've noticed that while the project is running if I unplug my controller and plug it back in it no longer works (sometimes it takes more than one unplug/plug back in). I've tried this also with my 8BitDo Pro 2 controller without it's battery plugged in, so I don't think it's a bluetooth issue. I tested this with the GLFW backend and this problem never occurs. I also tested working with just SDL2 directly and I don't think it's an SDL2 problem.
Environment
Windows, Desktop. SDL2 2.30.10, Raylib 5.5
Issue Screenshot
Here I start the .exe, plug in PS4 Controller, unplug, plug it back in (still works), and then when I unplug this time raylib still thinks the controller is plugged in. On plugging in any controller after this no gamepad input works.
https://github.com/user-attachments/assets/2e7dff57-0e9a-4832-9bab-9eca6942ed21
Code Example
I've attached a zip of my project.
raylib_c_test.zip
Below is the main file.
The text was updated successfully, but these errors were encountered: