Update rcore_android.c (#3910)
add gamepad previous button state tracking to Android
This commit is contained in:
parent
04afba260f
commit
a1f5e34d81
1 changed files with 10 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue