Commit Graph

14 Commits

Author SHA1 Message Date
Hajime Hoshi
51f83b1527 inpututil: Add APIs for the standard gamepad layout
This change adds these APIs to inpututil:

  * IsStandardGamepadButtonJustPressed
  * IsStandardGamepadButtonJustReleased
  * StandardGamepadButtonPressDuration

Closes #1557
2021-07-20 02:37:12 +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
bd5cc145df ebiten: Refactoring: Use aliases for GamepadButton and MouseButton 2021-07-19 00:57:35 +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
bf515bb594 Update version to v2.0.0-alpha 2020-10-04 04:30:40 +09:00
Hajime Hoshi
c5a8c88e2d input: Move MouseButton and GamepadButton to driver package 2019-03-30 23:19:52 +09:00
Hajime Hoshi
4de2dc0240 Add input package 2018-04-01 23:20:45 +09:00
Hajime Hoshi
a7fc463d91 doc: Improve comments 2017-10-01 03:15:50 +09:00
Hajime Hoshi
ae378dc7f5 input: Extend number of gamepad buttons from 16 to 32 (for PS4) 2017-02-25 22:49:17 +09:00
Hajime Hoshi
d62a90dfca input: Add GamepadButtonMax 2016-09-03 15:18:55 +09:00
Hajime Hoshi
623fa5cd24 input: Remove redundant type (oops) 2016-09-03 15:08:28 +09:00
Hajime Hoshi
8b565f94c6 input: Bug fix: GamepadButtonN must be GamepadButton type 2016-09-03 15:05:55 +09:00
Hajime Hoshi
a6b7eab71b Add Gamepad API 2015-01-12 02:29:56 +09:00