Commit Graph

8 Commits

Author SHA1 Message Date
Hajime Hoshi
d7bedd165a internal/driver: Bug fix: Compile error for browsers 2021-07-21 17:20:09 +09:00
Hajime Hoshi
93a156a718 internal/uidriver/glfw: Use glfwGameGamepadState
This change replaces the usage of gamepaddb package with glfwGetGamepadState.

Updates #1557
2021-07-21 16:09:30 +09:00
Hajime Hoshi
8656786721 internal/uidriver/js: Refactoring: Detect the standard layout at update 2021-07-20 21:56:15 +09:00
Hajime Hoshi
aa694be6f6 ebiten: Add the standard gamepad layout
This change introduces the standard gamepad layout. This changes adds
these APIs:

  * func HasGamepadStandardLayoutMapping
  * func IsGamepadStandardButtonPressed
  * func GamepadStandardAxisValue
  * type StandardGamepadButton
  * type StandardGamepadAxis

The standard gamepad layout is based on the web standard. See
https://www.w3.org/TR/gamepad/#remapping.

On desktops, the SDL's gamecontrllerdb.txt is used. If the gamepad is
listed in the text file, the mapping works. GLFW's mapping featrue is
not used.

On browsers, the property of a gamepad 'mapping' is used. When the
mapping value is 'standard', the gamepad is recognized to have the
standard mapping.

On mobiles, the implementation is still WIP.

Updates #1557
2021-07-20 01:32:28 +09:00
Hajime Hoshi
2ea360b921 Revert "driver: Increase gamepad buttons to 64"
This reverts commit 62b199f9eb.

Reason: This seems my misunderstanding.
2020-12-29 02:49:58 +09:00
Hajime Hoshi
62b199f9eb driver: Increase gamepad buttons to 64
e.g. Nintendo Switch controller can have more than 32 buttons.
2020-12-27 21:56:08 +09:00
Hajime Hoshi
8fcee54849 mobile/ebitenmobileview: Implement Android gamepad buttons
This is still work in progress.

Updates #1083
2020-03-23 01:30:17 +09:00
Hajime Hoshi
c5a8c88e2d input: Move MouseButton and GamepadButton to driver package 2019-03-30 23:19:52 +09:00