Commit Graph

102 Commits

Author SHA1 Message Date
Hajime Hoshi
8c25fac860 ebiten: add AppendDroppedFiles
Closes #1868
2023-01-22 17:22:25 +09:00
Hajime Hoshi
40aa35750c ebiten: bug fix: updating the input state must be protected by a mutex 2023-01-22 01:49:43 +09:00
Hajime Hoshi
b79f0394cc internal/ui: refactoring: allow slices in InputState 2023-01-22 01:28:57 +09:00
Hajime Hoshi
d53803615a internal/ui: merge a window-closing state into an input state 2023-01-21 23:42:48 +09:00
Hajime Hoshi
dd7e125d9c ebiten: add KeyName for desktops and browsers
Updates #1904
2022-12-25 03:37:29 +09:00
Hajime Hoshi
59295cc85f internal/ui: bug fix: input state should be reset for each tick, not frame
Before this change, input states were reset for each frame. When FPS
is bigger than TPS, the input state was reset more often than expected
and then some inputs were missing.

This change fixes the issue by resetting input states not for each frame
but for each tick.

This change also updates some comments of the input API.

Updates #2496
Closes #2501
2022-12-20 10:07:19 +09:00
Hajime Hoshi
d80f1112ed ebiten: bug fix: wrong detection of mod keys
Updates #2501
2022-12-20 03:40:14 +09:00
Hajime Hoshi
d1b9a0a9a1 internal/ui: freeze the input state for each frame
After this change, the input APIs will return more consistent results
for one frame.

Closes #2496
2022-12-18 23:54:43 +09:00
Hajime Hoshi
7f95072fce ebiten: typo 2022-09-28 03:24:36 +09:00
Hajime Hoshi
f7c44f086f replace Ebiten with Ebitengine in comments 2022-08-29 11:17:17 +09:00
Hajime Hoshi
094726915b
ebiten: add IsStandardGamepadAxisAvailable and IsStandardGamepadButtonAvailable (#2241)
Closes #2040
2022-08-11 12:35:20 +09:00
mattn
3cd0daac67
go generate ./... with Go 1.19 (#2228) 2022-08-03 20:48:02 +09:00
Hajime Hoshi
bacb630c5b internal/gamepaddb: bug fix: don't panic with invalid inputs
Closes #2218
2022-07-29 12:14:20 +09:00
Hajime Hoshi
5f17264c74 ebiten: rename Gamepad(Axis|Button)Num -> Gamepad(Axis|Button)Count 2022-07-13 01:27:14 +09:00
Hajime Hoshi
33078c764c internal/gamepaddb: make Update atomic
Closes #1978
2022-04-02 20:19:04 +09:00
Hajime Hoshi
80c03792cb internal/driver: move the key definitions to internal/ui
Updates #1983
2022-02-06 19:14:18 +09:00
Hajime Hoshi
2fbfa5444b internal/driver: remove Input 2022-02-06 18:34:31 +09:00
Hajime Hoshi
149736c3cf internal/uidriver/*: integrate the packages into internal/ui
Updates #1983
2022-02-06 17:23:04 +09:00
Hajime Hoshi
93b2a0756b internal/gamepaddb: allow the standard layout mapping for any platforms
Closes #1957
2022-02-06 03:38:02 +09:00
Hajime Hoshi
1bee10f999 internal/gamepad: move constants from internal/driver 2022-02-05 22:42:14 +09:00
Hajime Hoshi
3bdd8097b5 internal/uidriver: refactoring: remove the gamepad part
Use the gamepad package instead.
2022-02-05 22:32:31 +09:00
Hajime Hoshi
061614080a ebiten: fix comments 2021-12-19 23:58:55 +09:00
Hajime Hoshi
897ecdd5e6 ebiten: fix a wrong comment about IsKeyPressed 2021-12-19 23:48:19 +09:00
Hajime Hoshi
b11f17b281 internal/uidriver/mobile: Support gamepads on iOS
Closes #1105
2021-10-19 19:04:12 +09:00
Hajime Hoshi
ea12ede127 ebiten: Add StandardGamepadButtonValue
Closes #1721
2021-09-12 21:00:48 +09:00
Hajime Hoshi
f23dadb8ae
Add internal/gamepaddb (#1805)
This is basically a revert of 93a156a718.
This implements parsing the SDL gamepad mappings by Ebiten instead
of GLFW, so that Ebiten can handle parsing errors completely.

Closes #1802
2021-09-11 22:46:05 +09:00
Hajime Hoshi
a1e522e838 ebiten: Update comments 2021-08-23 22:13:46 +09:00
divVerent
7b11377bce
ebiten: Support updating the gamepad mapping (#1775)
This is only supported on desktops yet (on mobile standard layout isn't
implemented yet, and on the web this is the browser's responsibility).

Closes #1723
2021-08-23 21:44:49 +09:00
Hajime Hoshi
5004fdcf02 ebiten: Update comments 2021-07-20 02:53:13 +09:00
Hajime Hoshi
f192971080 ebiten: Rename HasGamepadStandardLayoutMapping -> IsStandardGamepadLayoutAvailable
Updates #1557
2021-07-20 02:46: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
f882dbda77 ebiten: Fix comments 2021-07-20 01:12:17 +09:00
Hajime Hoshi
dbcb220742 ebiten: Add GamepadAxisValue replacing GamepadAxis
Updates #1718
Closes #1719
2021-07-19 01:22:35 +09:00
Hajime Hoshi
bd5cc145df ebiten: Refactoring: Use aliases for GamepadButton and MouseButton 2021-07-19 00:57:35 +09:00
Hajime Hoshi
6bc22d4587 Unify 'deprecated' comment formats 2021-07-10 03:19:23 +09:00
Hajime Hoshi
431cd33839 ebiten: Add AppendInputChars, AppendGamepadIDs, and AppendTouchIDs
These functions reduce unnecessary allocations of arrays.

Closes #1692
2021-07-10 03:03:24 +09:00
Hajime Hoshi
99a6b1b03e internal/driver: Change some functions to Append*
Updates #1692
2021-07-10 01:52:21 +09:00
Hajime Hoshi
26bb1b5f31 ebiten: Refactoring: Stop using TouchIDs in TouchPosition 2021-07-10 01:38:54 +09:00
Hajime Hoshi
4398a5e227 ebiten: Change the key name convention to follow the Web standard
Closes #1394
2021-04-14 22:49:07 +09:00
Hajime Hoshi
4c22314b3a ebiten: Remove old comments 2021-04-14 00:21:15 +09:00
Hajime Hoshi
0246a6407e ebiten: Guarantee that CursorPosition returns (0, 0) in the very initial state on desktops
This change also guarantees that CursorPosition always returns (0, 0)
on mobiles.
2021-04-07 03:08:09 +09:00
Hajime Hoshi
763ed32ca6 ebiten: Update input API comments for Android
Closes #1539
2021-03-14 18:02:55 +09:00
Hajime Hoshi
14070ee153 uidriver: Copy the runes on the callee sides 2020-11-18 19:37:12 +09:00
Hajime Hoshi
5ee3fdf628 ebiten: Add KeySuper
Fixes #1382
2020-10-11 18:40:40 +09:00
Hajime Hoshi
b1c67c7661 ebiten: Introduce type TouchID
Fixes #604
2020-10-10 03:57:47 +09:00
Hajime Hoshi
809b7a3afa ebiten: Introduce type GamepadID
Updates #604
2020-10-08 01:57:08 +09:00
Hajime Hoshi
83ead375a4 ebiten: Update comments 2020-10-05 02:00:50 +09:00
Hajime Hoshi
1d4ff9a906 ebiten: Remove the deprecated functions and constants
Updates #1127
2020-10-04 04:47:24 +09:00
Hajime Hoshi
bf515bb594 Update version to v2.0.0-alpha 2020-10-04 04:30:40 +09:00
raa0121
e3e8b49047
ebiten: Add inpututil guide comments for Is{Key,MouseButton,Gamepad}Pressed and TouchIDs (#1346)
Fixes #1344
2020-09-15 19:29:07 +09:00