ebiten/internal/gamepad
Hajime Hoshi e2f26b9dac internal/gamepad: ignore the very first MotionEvent with 0 value for Android
On Android, MotionEvent with 0 values might come for axes when connecting
a gamepad, even though a user didn't touch any axes. This is problematic
especially for tirgger axes, where the default value should be -1.

This change fixes the issue by adding a new state `axesReady` to check
if an axis is really touched or not. If an axis is not touched yet,
a button value for a standard (trigger) button always returns 0.

This change also removes an old hack to initialize axis values for
triggers.

Closes #2598
2024-03-21 22:48:33 +09:00
..
api_cf_darwin.go all: bug fix: relative paths for dlopen didn't work on macOS Sonoma 2023-08-26 14:52:52 +09:00
api_desktop_windows.go all: remove old // +build comments (#2431) 2022-11-03 12:55:14 +09:00
api_hid_darwin.go all: bug fix: relative paths for dlopen didn't work on macOS Sonoma 2023-08-26 14:52:52 +09:00
api_ios.go all: remove old // +build comments (#2431) 2022-11-03 12:55:14 +09:00
api_linux.go internal/gamepad: native standard layout for Linux (#2587) 2023-03-04 01:47:24 +09:00
api_xbox_windows.go all: remove old // +build comments (#2431) 2022-11-03 12:55:14 +09:00
button.go internal/gamepad: rename ButtonNum -> ButtonCount 2022-09-07 15:40:52 +09:00
extern_android.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:48:33 +09:00
gamepad_android.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:48:33 +09:00
gamepad_darwin.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:48:33 +09:00
gamepad_desktop_windows.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:48:33 +09:00
gamepad_ios.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:48:33 +09:00
gamepad_js.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:48:33 +09:00
gamepad_linux.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:48:33 +09:00
gamepad_nintendosdk.cpp all: fix typos (#2558) 2023-01-28 19:06:38 +09:00
gamepad_nintendosdk.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:48:33 +09:00
gamepad_nintendosdk.h internal/gamepad: refactoring 2023-01-01 00:58:42 +09:00
gamepad_null.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:48:33 +09:00
gamepad_windows.go all: remove old // +build comments (#2431) 2022-11-03 12:55:14 +09:00
gamepad_xbox_windows.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:48:33 +09:00
gamepad.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:48:33 +09:00