ebiten/internal/gamepad
Hajime Hoshi b7dd45c0e4 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:28:48 +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 unnecessary build tag restrictions 2023-10-01 23:27:57 +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 unnecessary build tag restrictions 2023-10-01 23:27:57 +09:00
api_linux.go all: add files for PlayStation 5 2023-10-16 00:54:08 +09:00
api_xbox_windows.go all: remove unnecessary build tag restrictions 2023-10-01 23:27:57 +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:28:48 +09:00
gamepad_android.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:28:48 +09:00
gamepad_darwin.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:28:48 +09:00
gamepad_desktop_windows.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:28:48 +09:00
gamepad_ios.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:28:48 +09:00
gamepad_js.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:28:48 +09:00
gamepad_linux.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:28:48 +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:28:48 +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:28:48 +09:00
gamepad_playstation5.go all: add files for PlayStation 5 2023-10-16 00:54:08 +09:00
gamepad_windows.go all: remove unnecessary build tag restrictions 2023-10-01 23:27:57 +09:00
gamepad_xbox_windows.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:28:48 +09:00
gamepad.go internal/gamepad: ignore the very first MotionEvent with 0 value for Android 2024-03-21 22:28:48 +09:00