Commit Graph

37 Commits

Author SHA1 Message Date
Hajime Hoshi
82c41cea39 examples/gamepad: Fix the layout 2021-09-12 21:09:13 +09:00
Hajime Hoshi
ea12ede127 ebiten: Add StandardGamepadButtonValue
Closes #1721
2021-09-12 21:00:48 +09:00
Hajime Hoshi
f192971080 ebiten: Rename HasGamepadStandardLayoutMapping -> IsStandardGamepadLayoutAvailable
Updates #1557
2021-07-20 02:46:12 +09:00
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
6b949cede8 examples/gamepad: Always show signs for axis values 2021-07-19 02:19:42 +09:00
Hajime Hoshi
700052519c examples: Use GamepadAxisValue
Updates #1719
2021-07-19 01:31:20 +09:00
Hajime Hoshi
af150ad67b examples/gamepad: Show SDL ID on the terminal 2021-07-18 15:41:20 +09:00
Hajime Hoshi
e8ea4046cb inpututil: Add AppendJustConnectedGamepadIDs
Updates #1705
2021-07-10 22:32:19 +09:00
Hajime Hoshi
a615be69c7 examples: Add //go:build 2021-06-24 21:49:37 +09:00
Hajime Hoshi
809b7a3afa ebiten: Introduce type GamepadID
Updates #604
2020-10-08 01:57:08 +09:00
Hajime Hoshi
bb20e62435 examples/gamepad: Bug fix: Misuse of indices and gamepad IDs 2020-10-08 01:13:51 +09:00
Hajime Hoshi
47065f5f2c Remove supporting jsgo
Updates #1129
2020-10-07 00:46:07 +09:00
Hajime Hoshi
8f00c8fbf5 ebiten: Remove the argument from Update
Fixes #1260
2020-10-04 19:33:10 +09:00
Hajime Hoshi
bf515bb594 Update version to v2.0.0-alpha 2020-10-04 04:30:40 +09:00
Hajime Hoshi
8cb037e902 examples/gamepad: Sort gamepad ids when showing the states 2020-09-21 17:30:28 +09:00
Hajime Hoshi
29ef737413 examples/gamepad: Use RunGame
Updates #1111
2020-04-20 01:36:12 +09:00
Hajime Hoshi
d6d17a7e85 uidriver/js: Implement GamepadSDLID
Fixes #1053
2020-02-05 00:00:00 +09:00
Hajime Hoshi
3cd9dfd800 Rename IsRunningSlowly to IsDrawingSkipped
Fixes #643
2018-07-10 22:31:26 +09:00
Hajime Hoshi
a355d701ad inpututil: Replace JustDisconnectedGamepadIDs with IsGamepadJustDisconnected (#505) 2018-04-30 04:35:10 +09:00
Hajime Hoshi
b1c55f395f examples/gamepad: Refactoring 2018-04-30 03:07:02 +09:00
Hajime Hoshi
9d57350a42 inpututil: Add JustConnectedGamepadIDs / JustDisconnectedGamepadIDs
Fixes #505
2018-04-30 02:51:38 +09:00
Hajime Hoshi
eecb04eaea examples: Add jsgo build tag experimentally 2018-03-15 01:26:21 +09:00
Hajime Hoshi
a7fafc74e7 examples/gamepad: Add usage of inpututil 2018-02-17 03:52:16 +09:00
Hajime Hoshi
4f3682a130 examples: Add comments 2018-01-28 20:10:50 +09:00
Hajime Hoshi
7bcc9ee79f ui: Add GamepadIDs and remove IsGamepadPresent (#447) 2017-10-26 23:59:09 +09:00
Hajime Hoshi
0357f80411 examples/gamepad: Simplify the message 2017-10-26 03:52:23 +09:00
Hajime Hoshi
79e46c555e examples/gamepad: Show multiple gamepad status 2017-10-26 03:44:49 +09:00
Hajime Hoshi
600baf2cc7 ui: Add IsGamepadPresent
Fixes #447
2017-10-26 02:59:33 +09:00
Hajime Hoshi
a657cac229 examples: Call IsRunningSlowly (#354) 2017-05-16 10:35:58 +09:00
Hajime Hoshi
ef8da64680 examples: Remove unnecessary checks of returning values 2017-03-04 23:24:54 +09:00
Hajime Hoshi
7410a9d814 Add example tags again
This reverts commit 7a1d63fb02.
2016-08-26 00:40:39 +09:00
Hajime Hoshi
7a1d63fb02 Revert example tags 2016-08-17 23:33:31 +09:00
Hajime Hoshi
12732d3302 examples: Add example tag 2016-08-17 22:52:51 +09:00
Hajime Hoshi
8f1b7a2d0c examples: Add error checks 2016-08-03 10:57:50 +09:00
Hajime Hoshi
4bdf64a523 Swap import order 2016-02-16 01:13:04 +09:00
Hajime Hoshi
0f6c18fb1b Rename example -> examples 2016-02-11 03:07:14 +09:00