Browse Source

Update rcore_android.c (#3910)

add gamepad previous button state tracking to Android
pull/3914/head
Aria 9 months ago
committed by GitHub
parent
commit
a1f5e34d81
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      src/platforms/rcore_android.c

+ 10
- 0
src/platforms/rcore_android.c View File

@ -651,6 +651,16 @@ void PollInputEvents(void)
CORE.Input.Gamepad.lastButtonPressed = 0; // GAMEPAD_BUTTON_UNKNOWN
//CORE.Input.Gamepad.axisCount = 0;
for (int i = 0; i < MAX_GAMEPADS; i++)
{
if (CORE.Input.Gamepad.ready[i]) // Check if gamepad is available
{
// Register previous gamepad states
for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++)
CORE.Input.Gamepad.previousButtonState[i][k] = CORE.Input.Gamepad.currentButtonState[i][k];
}
}
// Register previous touch states
for (int i = 0; i < MAX_TOUCH_POINTS; i++) CORE.Input.Touch.previousTouchState[i] = CORE.Input.Touch.currentTouchState[i];

Loading…
Cancel
Save