ebiten/internal/gamepad
divVerent 06c141475c
internal/gamepad: native standard layout for Linux (#2587)
Implements native standard layout for Linux gamepads by using the kernel-provided button IDs, thereby expanding
support to gamepads not listed in gamecontrollerdb.txt.

Linux's docs: https://www.kernel.org/doc/Documentation/input/gamepad.txt
SDL2's source: https://fossies.org/linux/SDL2/src/joystick/linux/SDL_sysjoystick.c#l_1740

Note that I am NOT 100% convinced about the X/Y swap between Xbox and PlayStation controllers - the Xbox
compatible pad I have however does have BTN_NORTH and BTN_WEST swapped (and thus BTN_X and BTN_Y
assigned right), which confirms SDL's logic and opposes the kernel docs.

Tested with this gamepad: "20d6:2802 BDA Xbox ONE Core controller", label says "PowerA Model 1508491-02" - even
after clearing out gamecontrollerdb.txt, examples/gamepad shows a 100% correct mapping.

Closes #2052
2023-03-04 01:47:24 +09:00
..
api_cf_darwin.go update purego to v0.3.0-alpha 2023-03-04 01:22:54 +09:00
api_desktop_windows.go all: remove old // +build comments (#2431) 2022-11-03 12:55:14 +09:00
api_hid_darwin.go update purego to v0.3.0-alpha 2023-03-04 01:22:54 +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 all: remove old // +build comments (#2431) 2022-11-03 12:55:14 +09:00
gamepad_android.go internal/gamepad: refactor standard layout support to allow remapping in the per-platform implementations. (#2588) 2023-03-03 23:29:04 +09:00
gamepad_darwin.go update purego to v0.3.0-alpha 2023-03-04 01:22:54 +09:00
gamepad_desktop_windows.go internal/gamepad: refactor standard layout support to allow remapping in the per-platform implementations. (#2588) 2023-03-03 23:29:04 +09:00
gamepad_ios.go internal/gamepad: refactor standard layout support to allow remapping in the per-platform implementations. (#2588) 2023-03-03 23:29:04 +09:00
gamepad_js.go internal/gamepad: refactor standard layout support to allow remapping in the per-platform implementations. (#2588) 2023-03-03 23:29:04 +09:00
gamepad_linux.go internal/gamepad: native standard layout for Linux (#2587) 2023-03-04 01:47:24 +09:00
gamepad_nintendosdk.cpp all: fix typos (#2558) 2023-01-28 19:06:38 +09:00
gamepad_nintendosdk.go internal/gamepad: refactor standard layout support to allow remapping in the per-platform implementations. (#2588) 2023-03-03 23:29:04 +09:00
gamepad_nintendosdk.h internal/gamepad: refactoring 2023-01-01 00:58:42 +09:00
gamepad_null.go internal/gamepad: refactor standard layout support to allow remapping in the per-platform implementations. (#2588) 2023-03-03 23:29:04 +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: refactor standard layout support to allow remapping in the per-platform implementations. (#2588) 2023-03-03 23:29:04 +09:00
gamepad.go internal/gamepad: refactor standard layout support to allow remapping in the per-platform implementations. (#2588) 2023-03-03 23:29:04 +09:00