Commit Graph

9 Commits

Author SHA1 Message Date
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
divVerent
809ad991c2
internal/gamepad: refactor standard layout support to allow remapping in the per-platform implementations. (#2588)
Refactors native standard layout so standard axes and buttons can be implemented using any of axes, buttons or hats.

This is required to be able to implement a native standard layout mapping for Linux, as e.g. shoulder buttons can be
backed either by an analog or digital input.

Precedes #2587

Updates #2052
2023-03-03 23:29:04 +09:00
Artem Yadelskyi
5b53cef59e
all: remove old // +build comments (#2431)
Closes #2325
2022-11-03 12:55:14 +09:00
Hajime Hoshi
094726915b
ebiten: add IsStandardGamepadAxisAvailable and IsStandardGamepadButtonAvailable (#2241)
Closes #2040
2022-08-11 12:35:20 +09:00
Hajime Hoshi
bf27f25e26 internal/gamepad: bug fix: build failures on FreeBSD 2022-06-25 01:36:13 +09:00
Hajime Hoshi
1570c506ae internal/gamepad: port the implementation for Android 2022-02-05 17:27:24 +09:00
Hajime Hoshi
d0e8efca33 internal/gamepad: port the implementation for Android 2022-02-04 23:23:22 +09:00
Hajime Hoshi
ef45058037 internal/gamepad: implement for Linux
Updates #1452
2022-02-04 04:26:33 +09:00
Hajime Hoshi
f3f8f6177c internal/gamepad: add gamepad_null.go 2022-02-02 02:18:02 +09:00