electronstudio / raylib-python-cffi

Python CFFI bindings for Raylib
http://electronstudio.github.io/raylib-python-cffi
Eclipse Public License 2.0
152 stars 29 forks source link

Gamepad Input not Working #138

Closed Secant1 closed 1 month ago

Secant1 commented 1 month ago

Despite the "is_gamepad_available(0)" function returning True, neither gamepad button or axis commands are responsive to controller inputs (get_gamepad_axis_movement(0, 0) returns 0.0 no matter what, and is_gamepad_button_pressed(0) returns False but in even intervals returns True instead.

I am using a Nintendo Pro Controller plugged in via cable. Raylib 5.0.0.3 STATIC installed via "pip install raylib". Windows 10. When I used a playstation controller everything worked fine, it only refused to work with the nintendo controller, but that controller works completely fine on the controller web demo at raylib.com strangely enough.

electronstudio commented 1 month ago

Did you call begin_drawing() and end_drawing()? I believe gamepad input only updates on end_drawing().

Assuming you did then it sounds like a Raylib bug. Raylib-Python-CFFI is just a wrapper around the C library Raylib so you would have to write a C example and submit a bug to Raylib.

electronstudio commented 1 month ago

Comparing against the WASM version of Raylib isn't relevent, unless you are also using the WASM version of Raylib-Python-CFFI (and even then I'd probably avoid the additional complication and suggest comparing the native versions first)

Secant1 commented 1 month ago

I thought it was just strange and worth an issue ticket that while my playstation controller works perfectly fine, my nintendo controller doesn't work at all, when both work on the online demo at raylib.com.

electronstudio commented 1 month ago

Probably is worth an issue, but on Raylib rather than Raylib-Python-CFFI.

electronstudio commented 1 month ago

They also have a Discord server, which probably has more people willing to troubleshoot than their Github does.

electronstudio commented 1 month ago

Raylib may have better controller support if compiled with the SDL backend so you could try that. I wonder if we should do that as the default or whether it would just introduce problems in other areas. I guess we'll see what they ship as default in 5.5.

Anyway, I'm assuming you reported this as a Raylib issue and they resolved it but please re-open if they said it was a Raylib-Python-CFFI issue.