mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-06 03:18:14 +00:00
Update rcore_android.c (#3910)
add gamepad previous button state tracking to Android
This commit is contained in:
@@ -651,6 +651,16 @@ void PollInputEvents(void)
|
|||||||
CORE.Input.Gamepad.lastButtonPressed = 0; // GAMEPAD_BUTTON_UNKNOWN
|
CORE.Input.Gamepad.lastButtonPressed = 0; // GAMEPAD_BUTTON_UNKNOWN
|
||||||
//CORE.Input.Gamepad.axisCount = 0;
|
//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
|
// Register previous touch states
|
||||||
for (int i = 0; i < MAX_TOUCH_POINTS; i++) CORE.Input.Touch.previousTouchState[i] = CORE.Input.Touch.currentTouchState[i];
|
for (int i = 0; i < MAX_TOUCH_POINTS; i++) CORE.Input.Touch.previousTouchState[i] = CORE.Input.Touch.currentTouchState[i];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user