raysan5/raylib

[rcore] Previous gamepad button press isn't tracked on Android

AriaMoKr opened this issue · 0 comments

  • [*] I tested it on latest raylib version from master branch
  • [*] I checked there is no similar issue already reported
  • [*] I checked the documentation on the wiki
  • [*] My code has no errors or misuse of raylib

Issue description

Per #2709
The Android implementation doesn't currently update the previous button state so IsGamepadButtonPressed does not work.

Environment

Android 13 on Samsung Galaxy Tab S7

Issue Screenshot

N/A

Code Example

Take the gamepad sample (https://www.raylib.com/examples/core/loader.html?name=core_input_gamepad) and modify it by:
changing IsGamepadButtonDown to IsGamepadButtonPressed
instead of showing the button held it should briefly show the first press on the example app.
on the Android version it's behavior matches IsGamepadButtonDown due to not tracking previous button state.

I'll look at submitting a pull request to resolve.

(I used Bigfoot71's raymob template but verified that raylib master does not have previous button state currently)

btw #3487 mentions gamepad testing. This issue does not show up with the current examples but would need the above modification to be visible, so it might be useful to set a radio box in the example to switch between Down / Pressed testing.