SDL icon indicating copy to clipboard operation
SDL copied to clipboard

[SDL2] Xbox Controller D-Pad and rumble work on PC but not on Android

Open mechakotik opened this issue 10 months ago • 1 comments

I am using SDL_GameControllerGetButton to get D-Pad state. On Android, it always returns 0 even when some D-Pad button is pressed, while working fine on PC. Gamepad rumble is also broken on Android but not on PC. I am using SDL 2.30.2 and Xbox Series controller. Here is my gamepad handling code if it will help: link.

mechakotik avatar Apr 16 '24 21:04 mechakotik

Android only supports rumble via a wired gamepad connection, at least for Android 12 and Android 13. There are reports that Bluetooth rumble may work with an Xbox One controller connected via Bluetooth on Android 14.

jjensen avatar Apr 24 '24 00:04 jjensen

The D-pad works fine here, and I confirmed that Bluetooth Xbox controllers don't have rumble on Android 14.

Can you try this APK and see if it works for you? It's built using the latest SDL3 code in main. https://www.libsdl.org/tmp/testcontroller.apk

slouken avatar Oct 17 '24 19:10 slouken

It fails to install as it days it's incompatible with my device. I have Pixel 7 Pro.

I have just tested it with my game which is using recent (around a week old) SDL3 snapshot, and it still doesn't work, but maybe the problems are with my code.

mechakotik avatar Oct 17 '24 19:10 mechakotik

I've updated the APK, try again?

slouken avatar Oct 17 '24 19:10 slouken

It works fine, looks like the problems are with my code.

mechakotik avatar Oct 17 '24 19:10 mechakotik