Commit graph

141 commits

Author SHA1 Message Date
Yuri Sizov
55b74c7cdf Merge pull request #76045 from Eoin-ONeill-Yokai/steaminput-fix
Prevent double input events on gamepad when running through steam input
2023-07-12 17:16:36 +02:00
Eoin O'Neill
8de98dbf21 Prevent double input events on gamepad when running through steam input
During GDC and general testing on Steam Deck units, we found that single
gamepads would often register inputs twice under certain circumstances.
This was caused by SteamInput creating a new virtual device, which Godot
registers as a second gamepad. This resulted in two gamepad devices
reporting the same button presses, often leading to buggy input response
on games with no multi-device logic and other-wise could cause intended
Steam rebindings to not work as intended (for example, swapping o and x
on a playstation pad if that feature isn't supported by the game.)

SDL gets around this by taking in a list of devices that are to be
ignored. When valve sees a controller that wants to be rebound via
SteamInput, they push a new VID/PID entry onto the environment
variable `SDL_GAMECONTROLLER_IGNORE_DEVICES` for the original gamepad
so that all game inputs can be read from the virtual gamepad instead.

This leverages the same logic as we are already using SDL gamepad
related HID mappings.
2023-07-10 15:26:33 -07:00
Rémi Verschelde
81064cc239
Doctool: Remove version attribute from XML header
We don't use that info for anything, and it generates unnecessary diffs
every time we bump the minor version (and CI failures if we forget to
sync some files from opt-in modules (mono, text_server_fb).
2023-07-06 10:08:21 +02:00
Rémi Verschelde
346f1ab86b
Bump version to 4.2-dev
Keep on waitin'
2023-07-05 22:07:03 +02:00
Danil Alexeev
eb391d3302
Display BitField[Enum] in docs to distinguish from Enum 2023-06-15 17:23:02 +03:00
lawnjelly
a3ef092f18 Input - fix just pressed and released with short presses
Previously if an action was both pressed and released on the same tick or frame, `is_action_just_pressed()` would return false, resulting in missed input.

This PR separately the timestamp for pressing and releasing so each can be tested independently.
2023-06-12 11:14:58 +01:00
Hugo Locurcio
922d2b7034 Document the database for Input.get_joy_name() and Input.get_joy_guid() 2023-06-02 13:13:06 +02:00
VolTer
04562662d3 Overhaul the top sections of the class reference (Core classes) 2023-05-19 07:04:48 +02:00
Ninni Pipping
732ad382a6 Clarify that event handling does not affect Input 2023-05-09 13:19:02 +02:00
Rémi Verschelde
898873b91e
Merge pull request #76309 from Calinou/custom-mouse-cursor-error-compressed
Add support for VRAM-compressed custom mouse cursor images
2023-04-22 13:19:34 +02:00
Hugo Locurcio
303bf247de
Add support for VRAM-compressed custom mouse cursor images
No memory is actually saved when using this, so lossless modes are
still recommended as they look better and load faster.
2023-04-21 18:01:47 +02:00
Hugo Locurcio
92730fb07d
Document custom mouse cursors larger than 128×128 potentially having issues 2023-04-21 02:05:22 +02:00
Rémi Verschelde
1c1524a651
Bump version to 4.1-dev
Can't stop, won't stop, they said, huh?
2023-03-01 01:44:37 +01:00
Hugo Locurcio
91e2d699b4
Silence warp_mouse() warning in favor of documentation
This warning was spammed in the Android editor when using the
navigation joysticks in the 3D viewport when the finger slid over
the viewport's edges.
2023-01-25 23:44:32 +01:00
bruvzg
daad4aed62
Cleanup and unify keyboard input.
- Unify keycode values (secondary label printed on a key), remove unused hardcoded Latin-1 codes.
- Unify IME behaviour, add inline composition string display on Windows and X11.
- Add key_label (localized label printed on a key) value to the key events, and allow mapping actions to the unshifted Unicode events.
- Add support for physical keyboard (Bluetooth or Sidecar) handling on iOS.
- Add support for media key handling on macOS.

Co-authored-by: Raul Santos <raulsntos@gmail.com>
2023-01-23 15:08:12 +02:00
Hugo Locurcio
296b8f299a
Document image size restrictions for custom mouse cursors in HTML5 2023-01-20 10:19:36 +01:00
Rémi Verschelde
796690948f
Merge pull request #71022 from Sauermann/fix-captured-position-doc
Fix doc for position of captured mouse
2023-01-10 10:48:58 +01:00
Markus Sauermann
31346211f2 Fix doc for position of captured mouse
The position is not at the center of the screen but of the window.
2023-01-10 10:26:14 +01:00
Juan Linietsky
2b815df3c1 Use BitField<> in core type masks
* All core types masks are now correctly marked as bitfields.
* The enum hacks in MouseButtonMask and many other types are gone. This ensures that binders to other languages non C++ can actually implement type safe bitmasks.
* Most bitmask operations replaced by functions in BitField<>
* Key is still a problem because its enum and mask at the same time. While it kind of works in C++, this most likely can't be implemented safely in other languages and will have to be changed at some point. Mostly left as-is.
* Documentation and API dump updated to reflect bitfields in core types.
2023-01-08 22:17:40 +01:00
Hugo Locurcio
4a991887bf
Silence Input.vibrate_handheld() warning as it's already documented
The warning causes messages to be spammed if you are calling this
method in a game that runs on both desktop and mobile platforms,
unless you guard all calls to `Input.vibrate_handheld()` with
`OS.has_feature("mobile") or OS.has_feature("web")`.

Since the limitation is already documented (and is obvious enough
given the method's name), the warning message is redundant.
2022-12-16 01:12:20 +01:00
Rémi Verschelde
f7c611ab71
Style: Misc docs and comment style and language fixes
- Removed empty paragraphs in XML.
- Consistently use bold style for "Example:", on a new line.
- Fix usage of `[code]` when hyperlinks could be used (`[member]`, `[constant]`).
- Fix invalid usage of backticks for inline code in BBCode.
- Fix some American/British English spelling inconsistencies.
- Other minor fixes spotted along the way, including typo fixes with codespell.
- Don't specify `@GlobalScope` for `enum` and `constant`.
2022-11-02 19:01:18 +01:00
Hugo Locurcio
0fce78355d
Document the DisplayServer class
This also adds a link to the Command line tutorial on pages
that reference command line arguments, as the page covers some
general usage tips for CLI arguments (especially on macOS).
2022-10-27 18:24:55 +02:00
Fabio Alessandrelli
d20b32186f [Web] Rename JavaScript platform to Web.
Also rename export name from "HTML5" to "Web".
2022-08-29 11:52:00 +02:00
Andy Maloney
ea2192b99e [doc] Use "param" instead of "code" to refer to parameters (6) 2022-08-12 12:07:53 -04:00
Yuri Sizov
c5d7115038 Rename the argument tag to param in XML documentation 2022-08-08 22:34:31 +03:00
pattlebass
130e715ab9 HTML5: Add support for Input.vibrate_handheld() 2022-07-27 22:54:41 +03:00
Rémi Verschelde
00b3822306 Input: Re-enable input accumulation by default
I turned it off by mistake in #38697.
See also #62664 for details on this boolean's complex history :)
2022-07-03 12:16:16 +02:00
Rémi Verschelde
ecde7ce834
Merge pull request #61669 from fire-forge/input
Make Input `mouse_mode` and `use_accumulated_input` properties
2022-06-04 15:52:34 +02:00
FireForge
f16c33fff6 Make Input mouse_mode and use_accumulated_input properties 2022-06-03 14:19:38 -05:00
Raul Santos
3e53afd52c
Add array element type to get_connected_joypads 2022-06-03 20:37:46 +02:00
Haoyu Qiu
ffd5362187 Swap the meaning of CURSOR_WAIT and CURSOR_BUSY 2022-05-14 10:13:42 +08:00
Rémi Verschelde
74ae1ec545 doc: Update iOS hint for Input.vibrate_handheld after #60397 2022-04-27 09:45:44 +02:00
Markus Sauermann
0494e024d8 Rename warp mouse functions to warp_mouse 2022-03-27 14:12:01 +02:00
Marcel Admiraal
ea20049afc Ensure minimum modifiers are pressed when matching actions 2022-03-20 08:02:54 +00:00
Hugo Locurcio
b68dd2e189
Add an XML schema for documentation
This makes it easier to spot syntax errors when editing the
class reference. The schema is referenced locally so validation
can still work offline.

Each class XML's schema conformance is also checked on GitHub Actions.
2022-02-15 00:03:31 +01:00
Rémi Verschelde
bf0253bab9
Merge pull request #56764 from madmiraal/fix-45592-2 2022-02-03 18:10:30 +01:00
TechnicalSoup
3dc1fad262
Expand description for warp_mouse_position method
Add more detail to the description for the warp_mouse_position method, clarifying that the vector is in screen coordinates and relative to an origin at the top of the game window.
2022-02-03 10:11:25 +11:00
Andrii Doroshenko (Xrayez)
5d17fe7d0f Add Input.is_anything_pressed method 2022-01-20 20:55:14 +02:00
Marcel Admiraal
5c3600b29f Fix mouse velocity not changing fast enough
- Uses all accumulated movements when calculating velocity
- Discards old accumulated movements
- Sets last mouse velocity to zero when there is no movement
2022-01-13 18:51:34 +00:00
Rémi Verschelde
46624388d4
Merge pull request #56322 from madmiraal/fix-42450 2022-01-11 11:33:59 +01:00
Hugo Locurcio
d01e22f187
Document keyboard ghosting caveats in Input and InputEvent
This also adds recommendations for choosing between
`is_physical_key_pressed()` and `is_key_pressed()`.
2022-01-05 02:55:25 +01:00
Marcel Admiraal
3105d9b1f3 Rename speed to velocity when it's a directional Vector 2021-12-29 15:35:26 +00:00
kobewi
cb2bdcd286 Unexpose joy_connection_changed method 2021-12-06 13:10:17 +01:00
bruvzg
9877d91c4a
Add Input.is_physical_key_pressed method. 2021-11-23 11:14:19 +02:00
Rémi Verschelde
6c1bd4d227
Replace Godot docs URL with $DOCS_URL in XML class reference 2021-11-15 13:02:21 +01:00
Aaron Franke
3c0fdcc8ac
Use "enum class" for input enums 2021-11-12 15:37:54 -06:00
Rémi Verschelde
6c35e74228
Merge pull request #53812 from RandomShaper/expose_flush_input 2021-10-22 17:20:33 +02:00
Pedro J. Estébanez
6dc3fae201 Expose Input::flush_buffered_events() 2021-10-22 14:28:48 +02:00
Дмитрий Сальников
9b38e04fff Exposed setters for sensor values in Input class 2021-10-12 23:26:03 +03:00
Rémi Verschelde
294acad796
Merge pull request #53472 from akien-mga/doc-update-tutorial-links 2021-10-06 14:59:36 +02:00