Commit Graph

176 Commits

Author SHA1 Message Date
52e7b970af Merge pull request #111681 from Nintorch/joypad-led
Add support for setting a joypad's LED light color
2025-11-13 20:52:07 -06:00
08fb2e61e7 Merge pull request #111503 from JestemStefan/fix_111176
Fix `Input.is_joy_known` response for SDL joypads
2025-11-12 17:26:22 -06:00
a55242747a Add support for joypad LED lights 2025-11-12 06:01:03 +05:00
3f98a5472d Fix Input.is_joy_known response for SDL joypads 2025-11-11 23:23:46 +01:00
7ae67813a1 Support adding advanced joypad features 2025-10-20 19:28:06 +05:00
d61a337a70 Improve usage of String.split() vs get_slice() 2025-09-19 16:31:55 +02:00
52a5644b5f Merge pull request #108214 from Nintorch/fix-joypad-vendor-product
Fix `Input.get_joy_info()` regression after the SDL input driver PR
2025-09-01 11:14:12 -05:00
f28acf97d0 Fix Input.get_joy_info() regression
SDL input driver did not have the "xinput_index", "raw_name", "vendor_id" and "product_id" fields for this method and exposed an additional, essentially useless for the users "mapping_handled" field. This commit fixes these issues.
2025-08-29 22:13:40 +05:00
10fd7163d4 Add methods to check which event first triggered "just pressed/released" state. 2025-08-12 16:25:23 +03:00
efed435fa3 Fix screen_accum not being reset when it should be in Input::VelocityTrack
Resets `screen_accum` like `accum`.
2025-06-26 20:06:03 +08:00
0b3496fb4f Add support for SDL3 joystick input driver
Made possible by EIREXE, xsellier and the SDL team.

This commit includes statically linked SDL3 for Windows, Linux and macOS.
The vendored copy of SDL3 was setup to only build the required subsystems
for gamepad/joystick support, with some patches to be able to make it as
minimal as possible and reduce the impact on binary size and code size.

Co-authored-by: Álex Román Núñez <eirexe123@gmail.com>
Co-authored-by: Xavier Sellier <xsellier@gmail.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2025-06-25 01:28:50 +02:00
5af4bef46f Inline static variables (part 1) 2025-04-29 18:10:44 +02:00
331a43a9d8 Add String::remove_char(s) methods for performance and convenience 2025-03-10 13:19:28 +01:00
466590d0ec Use get_slicec instead of get_slice for single character splitters 2025-03-08 20:36:37 +01:00
5113022dfe Clean up some uses of String::substr
Cases where the end position is either equvalent to the default or past
the end of the string.
2025-03-07 14:50:38 +01:00
93bababb8c Android: Inform that sensors must be enabled in ProjectSettings 2025-02-21 23:04:01 +05:30
47f553ae0b Delegate to the DisplayServer the task of handling mouse_mode
- Add `MOUSE_MODE_MAX` and various index checks
2025-01-28 11:22:27 -05:00
8e75fae49e Ue an array removed_idx 2025-01-14 12:09:16 +01:00
f355382ef5 Updating the index after the first mapping record of p_guid requires a second loop 2025-01-13 16:55:26 +01:00
e98f3a6bf0 Apply feedback 2025-01-13 16:23:55 +01:00
f7c6a8659a Apply feedback + Remove unused variable uid in parse_mapping() 2025-01-13 11:43:25 +01:00
40832387ce Fix Input::remove_joy_mapping
Erasing a joypad mapping can invalidate other attached joypads and the fallback mapping guid
2024-12-16 20:27:33 +01:00
01a2726c59 Get joypad's vendor ID, product ID, and name on Windows 2024-12-15 23:59:11 +01:00
4e19ab8afe Fix connecting a signal with a double click is too difficult
Co-authored-by: Danil Alexeev <dalexeev12@yandex.ru>
2024-12-14 16:18:34 +03:00
68f638cf02 Use (r)find_char instead of (r)find for single characters 2024-11-17 10:02:18 +01:00
bb5f390fb9 Style: Apply clang-tidy fixes (superficial)
• `modernize-use-bool-literals`, `modernize-use-nullptr`, and `readability-braces-around-statements`
2024-11-04 12:11:14 -06:00
16524a8a01 Add "Game" editor for better runtime debugging 2024-10-30 11:42:17 -03:00
fd6138ed7e Fixes window_id being erased when emulating mouse events from touch events 2024-10-18 15:37:39 -04:00
a57a99f5bc Memory cleanup and optimizations
- Returns an empty list when there's not registered plugins, thus preventing the creation of spurious iterator objects

- Inline `Godot#getRotatedValues(...)` given it only had a single caller. This allows to remove the allocation of a float array on each call and replace it with float variables

- Disable sensor events by default. Sensor events can fired at 10-100s Hz taking cpu and memory resources. Now the use of sensor data is behind a project setting allowing projects that have use of it to enable it, while other projects don't pay the cost for a feature they don't use

- Create a pool of specialized input `Runnable` objects to prevent spurious, unbounded `Runnable` allocations

- Disable showing the boot logo for Android XR projects

- Delete locale references of jni strings
2024-08-16 09:27:41 -07:00
59737bf3f0 Merge pull request #94413 from rburing/fix_action_press_tick
Fix physics tick count in `Input.action_press` and `Input.action_release`
2024-07-17 11:44:31 +02:00
496fd12b17 Merge pull request #94052 from m4gr3d/clean_input_dispatch_settings
Cleanup Android input on render thread settings
2024-07-17 11:42:52 +02:00
b41ec93d63 Fix physics tick count in Input.action_press and Input.action_release
The physics tick count was not yet updated there.
2024-07-16 00:31:44 +02:00
5e59819727 Cleanup Android input on render thread settings
Follow up to https://github.com/godotengine/godot/pull/93933
Clean up the set of settings use to control whether Android input should be dispatched on the render thread.

Addresses comments in https://github.com/godotengine/godot/pull/93933#issuecomment-2210437977
2024-07-09 09:15:18 -07:00
23521635d2 Fix physics tick counter
The counter is now incremented at the start of a physics tick rather than at the end.

Co-authored-by: lawnjelly <lawnjelly@gmail.com>
2024-07-07 19:04:05 +02:00
62120c7841 Fix Steam input "crc" errors, and some other Coverity reports of uninitialized scalar variable
- Fixes #88630.
- Fixes #92578.
2024-05-31 09:55:02 +02:00
be2c5e66f4 Merge pull request #92201 from bruvzg/input_flush
Clean `Input::frame_parsed_events` before de-initialising scripting languages to ensure no script created events exist at the exit.
2024-05-30 15:41:56 +02:00
17d3f26e5d Add event_index to InputEventAction 2024-05-30 12:51:15 +02:00
2c9df769ad Clean Input::frame_parsed_events before de-initialising scripting languages to ensure no script created events exist at the exit. 2024-05-30 13:23:00 +03:00
1069d7b7c6 Merge pull request #88343 from Riteo/warped-mouse-float
Handle warped mouse motion as floating point
2024-05-06 15:14:46 +02:00
789c6ebdfd Implement amplitude to Input.vibrate_handheld
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: m4gr3d <m4gr3d@users.noreply.github.com>
2024-05-02 19:09:42 +03:00
41e70db8b1 Fix action_press() by clamping strength to 0, 1
Changed Input.action_press() treatment of strength parameter to match
behavior of InputEventAction and documentation, by clamping between 0
and 1. Fixes Input.get_action_strength() returning values over 1 when
large values are passed to Input.action_press().
2024-03-27 11:17:40 -04:00
cd2032a90b Optimise Object's get_argument_options 2024-02-29 18:00:54 +01:00
759a32eb0c Handle warped mouse motion as floating point
Fixes certain issues where sub-pixel motions would get discarded while
the mouse is captured, such as when free look is enabled in the editor
(at least when turned on while holding right click).

Very slightly compat breaking, as actual public APIs are changed,
although with "compatible" types (Point2i->Point2).
2024-02-14 22:37:51 +01:00
a8bc9f3e78 Add const lvalue ref to core/* container parameters 2024-02-14 11:20:36 -03:00
2235a1cbd0 Add screen-related attributes to mouse input events 2024-02-05 23:30:15 +01:00
4b3a12f4ee Check action exists in Input.action_press and action_release 2024-01-18 16:18:16 +08:00
6c390b620d Merge pull request #84445 from Rubonnek/add-const-references-clang-tidy
Add const references detected by clang-tidy
2024-01-04 14:25:33 +01:00
ca2f340384 Fix missing autocompletion for inheriting classes 2024-01-03 00:13:04 +01:00
a3cb1b096f Add const references detected by clang-tidy 2023-12-16 13:36:44 -05:00
075a54bbcf Add bindings for setting and getting emulation mouse from touch and touch from mouse in input 2023-12-13 08:07:36 +03:00