summaryrefslogtreecommitdiff
path: root/core/input/input.cpp
AgeCommit message (Collapse)Author
2023-02-09Perform early exit in Input::is_anything_pressedNinni Pipping
2023-02-06Fix mouse/drag/touch InputEvents having no device idMarkus Sauermann
Some internally created emulated/instantiated events didn't have a device id. This PR sets for these cases a device id. Also rename `DEVICE_ID_TOUCH_MOUSE` to the more generic `DEVICE_ID_EMULATION`.
2023-02-01Fix various typos with codespellRémi Verschelde
Finally do the childs -> children rename too.
2023-01-31Merge pull request #64423 from RandomShaper/safe_input_synthRémi Verschelde
Warn users about unsafe usage of `InputEvent`
2023-01-31Warn users about unsafe usage of InputEventPedro J. Estébanez
2023-01-25Merge pull request #69028 from YeldhamDev/its_raw_you_donkeyRémi Verschelde
Make `Input.get_vector()` check for plain `strength` instead of the raw one
2023-01-23Cleanup and unify keyboard input.bruvzg
- 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-08Use BitField<> in core type masksJuan Linietsky
* 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-05One Copyright Update to rule them allRémi Verschelde
As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
2022-12-23[iOS] Add Apple Pencil pressure and tilt support.bruvzg
2022-11-22Make `Input.get_vector()` check for plain `strength` instead of the raw oneMichael Alexsander
2022-11-02Style: Misc docs and comment style and language fixesRémi Verschelde
- 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-10-22Add double_tap attribute to InputEventScreenTouchFredia Huya-Kouadio
This provides parity with the `InputEventMouseButton` allowing for proper conversion between the two events.
2022-10-07Fix MSVC warnings, rename shadowed variables, fix uninitialized values, ↵bruvzg
change warnings=all to use /W4.
2022-09-01Merge pull request #64444 from timothyqiu/action-completionRémi Verschelde
Fix action name completion for `Input`
2022-08-24Merge pull request #64531 from madmiraal/fix-63972-2Rémi Verschelde
Fix axis mapped to DPad buttons not releasing opposite button
2022-08-22Consolidate the fact that `Input` is meant to be finalPedro J. Estébanez
This reverts #38034 and removes the `iteration()` method.
2022-08-17Fix axis mapped to DPad buttons not releasing opposite buttonMarcel Admiraal
2022-08-15Fix action name completion for `Input`Haoyu Qiu
2022-08-04Fix some array size function definition mismatch.Fabio Alessandrelli
2022-06-28Input: Make `get_action_raw_strength` print error when the action doesn't existMarco F
2022-06-04Merge pull request #61669 from fire-forge/inputRémi Verschelde
Make Input `mouse_mode` and `use_accumulated_input` properties
2022-06-03Make Input mouse_mode and use_accumulated_input propertiesFireForge
2022-06-03Add array element type to `get_connected_joypads`Raul Santos
2022-05-16Replace most uses of Map by HashMapreduz
* Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
2022-05-12Add a new HashMap implementationreduz
Adds a new, cleaned up, HashMap implementation. * Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing). * Keeps elements in a double linked list for simpler, ordered, iteration. * Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much for performance vs keeping the key, but helps replace old code). * Uses a more modern C++ iterator API, deprecates the old one. * Supports custom allocator (in case there is a wish to use a paged one). This class aims to unify all the associative template usage and replace it by this one: * Map<> (whereas key order does not matter, which is 99% of cases) * HashMap<> * OrderedHashMap<> * OAHashMap<>
2022-05-03Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`Hugo Locurcio
These typedefs don't save much typing compared to the full `Ref<Resource>` and `Ref<RefCounted>`, yet they sometimes introduce confusion among new contributors.
2022-04-22Use Input::push_input for tests plus extra mouse testingPaulb23
2022-04-14Merge pull request #60208 from Magorx/input-set-custom-mouse-cursor-fixRémi Verschelde
Added p_shape check to avoid engine crash in DisplayServer
2022-04-13Added p_shape check to avoid engine crushKingCakeTheFruity
2022-04-06Fix some issues found by cppcheck.bruvzg
2022-03-27Rename warp mouse functions to warp_mouseMarkus Sauermann
2022-02-16Style: Cleanup single-line blocks, semicolons, dead codeRémi Verschelde
Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported.
2022-02-03Merge pull request #56764 from madmiraal/fix-45592-2Rémi Verschelde
2022-01-24Merge pull request #56754 from madmiraal/fix-45592Rémi Verschelde
2022-01-20Add `Input.is_anything_pressed` methodAndrii Doroshenko (Xrayez)
2022-01-14Fix Actions mapped to triggers not using the full rangeMarcel Admiraal
2022-01-13Fix mouse velocity not changing fast enoughMarcel Admiraal
- Uses all accumulated movements when calculating velocity - Discards old accumulated movements - Sets last mouse velocity to zero when there is no movement
2022-01-13Use mouse event relative motion to calculate mouse velocityMarcel Admiraal
2022-01-11Merge pull request #56322 from madmiraal/fix-42450Rémi Verschelde
2022-01-10Add joystick button index boundary check. Increase max. button number to 128 ↵bruvzg
(max. buttons supported by DirectInput).
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-12-29Rename speed to velocity when it's a directional VectorMarcel Admiraal
2021-12-17Revert "Fixed event spam when using the Nintendo Switch controller"Marcel Admiraal
2021-12-16Fixed event spam when using the Nintendo Switch controllerSam Lantinga
There is no filtering on the Nintendo Switch Pro controller thumbstick, so there will frequently be events with very slight change. These are turned into "not pressed" events, which cancel "pressed" events from keys and buttons. This change filters out up to 5% jitter, but it might be worth revisiting whether "not pressed" events should cancel "pressed" events.
2021-12-09Replace String comparisons with "", String() to is_empty()Nathan Franke
Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
2021-12-06Unexpose joy_connection_changed methodkobewi
2021-11-23Rename `remove()` to `remove_at()` when removing by indexLightning_A
2021-11-23Add Input.is_physical_key_pressed method.bruvzg
2021-11-16Rename built-in `SGN()` macro to `SIGN()`Hugo Locurcio
This matches the name of the GDScript function (except it's uppercase here).