Commit Graph

136 Commits

Author SHA1 Message Date
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
922d2b7034 Document the database for Input.get_joy_name() and Input.get_joy_guid() 2023-06-02 13:13:06 +02:00
04562662d3 Overhaul the top sections of the class reference (Core classes) 2023-05-19 07:04:48 +02:00
732ad382a6 Clarify that event handling does not affect Input 2023-05-09 13:19:02 +02:00
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
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
92730fb07d Document custom mouse cursors larger than 128×128 potentially having issues 2023-04-21 02:05:22 +02:00
1c1524a651 Bump version to 4.1-dev
Can't stop, won't stop, they said, huh?
2023-03-01 01:44:37 +01:00
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
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
296b8f299a Document image size restrictions for custom mouse cursors in HTML5 2023-01-20 10:19:36 +01:00
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
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
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
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
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
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
d20b32186f [Web] Rename JavaScript platform to Web.
Also rename export name from "HTML5" to "Web".
2022-08-29 11:52:00 +02:00
ea2192b99e [doc] Use "param" instead of "code" to refer to parameters (6) 2022-08-12 12:07:53 -04:00
c5d7115038 Rename the argument tag to param in XML documentation 2022-08-08 22:34:31 +03:00
130e715ab9 HTML5: Add support for Input.vibrate_handheld() 2022-07-27 22:54:41 +03:00
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
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
f16c33fff6 Make Input mouse_mode and use_accumulated_input properties 2022-06-03 14:19:38 -05:00
3e53afd52c Add array element type to get_connected_joypads 2022-06-03 20:37:46 +02:00
ffd5362187 Swap the meaning of CURSOR_WAIT and CURSOR_BUSY 2022-05-14 10:13:42 +08:00
74ae1ec545 doc: Update iOS hint for Input.vibrate_handheld after #60397 2022-04-27 09:45:44 +02:00
0494e024d8 Rename warp mouse functions to warp_mouse 2022-03-27 14:12:01 +02:00
ea20049afc Ensure minimum modifiers are pressed when matching actions 2022-03-20 08:02:54 +00:00
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
bf0253bab9 Merge pull request #56764 from madmiraal/fix-45592-2 2022-02-03 18:10:30 +01:00
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
5d17fe7d0f Add Input.is_anything_pressed method 2022-01-20 20:55:14 +02:00
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
46624388d4 Merge pull request #56322 from madmiraal/fix-42450 2022-01-11 11:33:59 +01:00
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
3105d9b1f3 Rename speed to velocity when it's a directional Vector 2021-12-29 15:35:26 +00:00
cb2bdcd286 Unexpose joy_connection_changed method 2021-12-06 13:10:17 +01:00
9877d91c4a Add Input.is_physical_key_pressed method. 2021-11-23 11:14:19 +02:00
6c1bd4d227 Replace Godot docs URL with $DOCS_URL in XML class reference 2021-11-15 13:02:21 +01:00
3c0fdcc8ac Use "enum class" for input enums 2021-11-12 15:37:54 -06:00
6c35e74228 Merge pull request #53812 from RandomShaper/expose_flush_input 2021-10-22 17:20:33 +02:00
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
294acad796 Merge pull request #53472 from akien-mga/doc-update-tutorial-links 2021-10-06 14:59:36 +02:00
862994a8ef doc: Update links to latest documentation after content reorganization 2021-10-06 13:48:48 +02:00
92a53f9bd6 Change dragging cursor on Windows 2021-10-06 13:13:42 +02:00
fa3a32a2d6 Use Key enum instead of plain integers 2021-08-10 16:26:55 -05:00
7adf4cc9b5 doc: Use self-closing tags for return and argument
For the time being we don't support writing a description for those, preferring
having all details in the method's description.

Using self-closing tags saves half the lines, and prevents contributors from
thinking that they should write the argument or return documentation there.
2021-07-30 15:29:52 +02:00
55206ecb76 Add Input documentation for exact_match 2021-07-30 15:21:35 +02:00