193 Commits

Author SHA1 Message Date
Rémi Verschelde 98868393cc Style: Enforce #include validation hook 2026-03-18 10:41:59 +01:00
Thaddeus Crews bb1e018314 Merge pull request #115119 from Nintorch/joypad-unfocused
Add project setting to ignore joypad events if the app is unfocused
2026-03-04 11:20:39 -06:00
Rémi Verschelde 765362b033 Explicitly include core/config/engine.h where used 2026-03-04 10:17:10 +01:00
Nintorch d418d692b9 Project setting to ignore joypads on unfocused app
Co-Authored-By: Christoph Taucher <4498502+chtau@users.noreply.github.com>
2026-03-03 11:03:37 +05:00
Thaddeus Crews e380a41752 Style: Add class_db.h includes explicitly 2026-02-26 15:50:28 -06:00
Thaddeus Crews 5e10528397 Merge pull request #114895 from Nintorch/is-joy-vibrating
Add support for joypad vibration checking
2026-02-19 20:29:13 -06:00
Nintorch c83c672d61 Add support for joypad vibration checking 2026-02-19 21:34:06 +05:00
CHIKI Badreddine bea703ae12 Input: Add missing MISC2-MISC6 gamepad button constants
The MISC2-MISC6 button strings are recognized by SDL3 but were not
mapped in Godot's JoyButton enum, causing 'Unrecognized output string'
warnings for controllers that use these buttons.

This adds:
- JoyButton::MISC2-MISC6 enum values (21-25)
- 'misc2'-'misc6' string mappings in _joy_buttons array
- GDScript bindings for JOY_BUTTON_MISC2 through JOY_BUTTON_MISC6
- Documentation entries in @GlobalScope.xml
- Updates JoyButton::SDL_MAX from 21 to 26
2026-02-17 21:12:23 +00:00
Thaddeus Crews f3d72eb13a Merge pull request #115266 from Nintorch/fix-joypad-editor-tooltips
Fix editor tooltips disappearing with joypad button presses
2026-02-02 12:57:23 -06:00
Nintorch eb019511ed Optimize files that #include input.h header 2026-01-28 14:21:00 +05:00
Nintorch a3eb202b25 Add support for joypad motion sensors 2026-01-26 15:49:55 +05:00
Nintorch 008266c4fe Fix editor tooltips disappearing with joypads 2026-01-22 18:51:55 +05:00
Nintorch 22a4f9fd9c Refactor Input.set_joy_light() 2026-01-11 22:52:40 +05:00
Nintorch d78fdeac13 Fix Android joypad triggers range 2025-12-27 13:35:55 +05:00
Rémi Verschelde 40c5b2110e Merge pull request #112995 from zedzee37/touch_window_fix
Fix emulated touch events using the incorrect window ID
2025-12-09 17:16:54 +01:00
David Snopek fc92ce3e7f Use RequiredParam/RequiredResult in some high value places 2025-12-02 10:44:12 -06:00
carsonuderitz@gmail.com ca45ce91b7 fix emulated touch events using the incorrect window id 2025-11-20 15:26:53 -05:00
Thaddeus Crews 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
Thaddeus Crews 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
Nintorch a55242747a Add support for joypad LED lights 2025-11-12 06:01:03 +05:00
JestemStefan 3f98a5472d Fix Input.is_joy_known response for SDL joypads 2025-11-11 23:23:46 +01:00
Nintorch 7ae67813a1 Support adding advanced joypad features 2025-10-20 19:28:06 +05:00
kobewi d61a337a70 Improve usage of String.split() vs get_slice() 2025-09-19 16:31:55 +02:00
Thaddeus Crews 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
Nintorch 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
Pāvels Nadtočajevs 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
Nintorch 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
kobewi 5af4bef46f Inline static variables (part 1) 2025-04-29 18:10:44 +02:00
A Thousand Ships 331a43a9d8 Add String::remove_char(s) methods for performance and convenience 2025-03-10 13:19:28 +01:00
A Thousand Ships 466590d0ec Use get_slicec instead of get_slice for single character splitters 2025-03-08 20:36:37 +01:00
A Thousand Ships 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
Anish Mishra 93bababb8c Android: Inform that sensors must be enabled in ProjectSettings 2025-02-21 23:04:01 +05:30
Adam Scott 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
MJacred 8e75fae49e Ue an array removed_idx 2025-01-14 12:09:16 +01:00
MJacred f355382ef5 Updating the index after the first mapping record of p_guid requires a second loop 2025-01-13 16:55:26 +01:00
MJacred e98f3a6bf0 Apply feedback 2025-01-13 16:23:55 +01:00
MJacred f7c6a8659a Apply feedback + Remove unused variable uid in parse_mapping() 2025-01-13 11:43:25 +01:00
MJacred 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
MJacred 01a2726c59 Get joypad's vendor ID, product ID, and name on Windows 2024-12-15 23:59:11 +01:00
Hilderin 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
A Thousand Ships 68f638cf02 Use (r)find_char instead of (r)find for single characters 2024-11-17 10:02:18 +01:00
Thaddeus Crews 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
Michael Alexsander 16524a8a01 Add "Game" editor for better runtime debugging 2024-10-30 11:42:17 -03:00
alexkar598 fd6138ed7e Fixes window_id being erased when emulating mouse events from touch events 2024-10-18 15:37:39 -04:00
Fredia Huya-Kouadio 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
Rémi Verschelde 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
Rémi Verschelde 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
Ricardo Buring 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
Fredia Huya-Kouadio 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