|
|
@@ -765,7 +765,7 @@ void InitWindow(int width, int height, const char *title)
|
|
|
CORE.Input.Keyboard.exitKey = KEY_ESCAPE;
|
|
|
CORE.Input.Mouse.scale = (Vector2){ 1.0f, 1.0f };
|
|
|
CORE.Input.Mouse.cursor = MOUSE_CURSOR_ARROW;
|
|
|
- CORE.Input.Gamepad.lastButtonPressed = -1;
|
|
|
+ CORE.Input.Gamepad.lastButtonPressed = 0; // GAMEPAD_BUTTON_UNKNOWN
|
|
|
#if defined(SUPPORT_EVENTS_WAITING)
|
|
|
CORE.Window.eventWaiting = true;
|
|
|
#endif
|
|
|
@@ -4871,7 +4871,7 @@ void PollInputEvents(void)
|
|
|
|
|
|
#if !(defined(PLATFORM_RPI) || defined(PLATFORM_DRM))
|
|
|
// Reset last gamepad button/axis registered state
|
|
|
- CORE.Input.Gamepad.lastButtonPressed = -1;
|
|
|
+ CORE.Input.Gamepad.lastButtonPressed = 0; // GAMEPAD_BUTTON_UNKNOWN
|
|
|
CORE.Input.Gamepad.axisCount = 0;
|
|
|
#endif
|
|
|
|
|
|
@@ -5714,14 +5714,15 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event)
|
|
|
CORE.Input.Gamepad.ready[0] = true;
|
|
|
|
|
|
GamepadButton button = AndroidTranslateGamepadButton(keycode);
|
|
|
- if (button == GAMEPAD_BUTTON_UNKNOWN)
|
|
|
- return 1;
|
|
|
+
|
|
|
+ if (button == GAMEPAD_BUTTON_UNKNOWN) return 1;
|
|
|
|
|
|
if (AKeyEvent_getAction(event) == AKEY_EVENT_ACTION_DOWN)
|
|
|
{
|
|
|
CORE.Input.Gamepad.currentButtonState[0][button] = 1;
|
|
|
}
|
|
|
else CORE.Input.Gamepad.currentButtonState[0][button] = 0; // Key up
|
|
|
+
|
|
|
return 1; // Handled gamepad button
|
|
|
}
|
|
|
|
|
|
@@ -6685,7 +6686,7 @@ static void *GamepadThread(void *arg)
|
|
|
CORE.Input.Gamepad.currentButtonState[i][gamepadEvent.number] = (int)gamepadEvent.value;
|
|
|
|
|
|
if ((int)gamepadEvent.value == 1) CORE.Input.Gamepad.lastButtonPressed = gamepadEvent.number;
|
|
|
- else CORE.Input.Gamepad.lastButtonPressed = -1;
|
|
|
+ else CORE.Input.Gamepad.lastButtonPressed = 0; // GAMEPAD_BUTTON_UNKNOWN
|
|
|
}
|
|
|
}
|
|
|
else if (gamepadEvent.type == JS_EVENT_AXIS)
|