Commit graph

330 commits

Author SHA1 Message Date
Rémi Verschelde
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
Rémi Verschelde
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
kobewi
17d3f26e5d Add event_index to InputEventAction 2024-05-30 12:51:15 +02:00
bruvzg
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
Jakub Marcowski
d9f8ef68df
Update pre-commit hooks configuration to use ruff instead of black 2024-05-21 18:02:29 -05:00
Rémi Verschelde
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
Radiant
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
Rémi Verschelde
1da02fa7be
Sync controller mappings DB with SDL 2 community repo
Synced with mdqinc/SDL_GameControllerDB@5b4efa3a20
2024-04-24 11:55:55 +02:00
Rémi Verschelde
6772047e50
Sync controller mappings DB with SDL 2 community repo
Synced with mdqinc/SDL_GameControllerDB@4c9b8dace8
2024-04-08 22:22:30 +02:00
Mark Wilson
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
Rémi Verschelde
f371b7fb70 Merge pull request #87883 from TontonSancho/text-skip-occurence
Add 'Skip to next (text) occurrence' feature to text editor
2024-03-25 13:15:56 +01:00
Christophe Andral
c988bec4b3 Add 'Skip to next (text) occurrence' feature to text editor
Adds `ui_text_skip_selection_for_next_occurrence` action and related implementation to text editor.
This action is bound `Ctrl+Alt+D` shorcut.

Used in conjonction with `ui_add_skip_selection_for_next_occurrence`, it gives the user the ability to select many occurrences of a selection
and avoid some of them.
Used without a previous selection, the action jumps to the next occurrence of the current word under the caret.
2024-03-25 11:12:28 +01:00
A Thousand Ships
4933fa8bf5
[Buildsystem] Fix encoding when reading files 2024-03-24 18:02:56 +01:00
Hugo Locurcio
6818e50adc Expose DEVICE_ID_EMULATION constant in InputEvent
This also improves the documentation related to emulated InputEvents.
2024-03-16 19:16:40 +01:00
Thaddeus Crews
5a6e3cbcb0
SCons: Remove run_in_subprocess dependency 2024-03-11 13:20:09 -05:00
Thaddeus Crews
fb299d0fb1
SCons: Ensure with statement where applicable 2024-03-10 12:57:57 -05:00
Thaddeus Crews
d9fa40f2df
Enforce \n eol for Python writes
• Ensure utf-8 encoding if previously unspecified
2024-03-09 14:29:24 -06:00
Thaddeus Crews
0ce9b6fd1d
Add two new COMSTR environment variables 2024-03-01 12:44:03 -06:00
Micky
70b428041b Add autocompletion for InputMap's methods 2024-03-01 16:44:26 +01:00
Micky
cd2032a90b Optimise Object's get_argument_options 2024-02-29 18:00:54 +01:00
Riteo
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
Muller-Castro
a8bc9f3e78 Add const lvalue ref to core/* container parameters 2024-02-14 11:20:36 -03:00
Markus Sauermann
2235a1cbd0 Add screen-related attributes to mouse input events 2024-02-05 23:30:15 +01:00
Rémi Verschelde
10445d80d8
Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@232c738ce0
2024-01-30 15:14:27 +01:00
Mel Collins
8406e60522 Add InputEventKey.location to tell left from right
This adds a new enum `KeyLocation` and associated property
`InputEventKey.location`, which indicates the left/right location of key
events which may come from one of two physical keys, eg. Shift, Ctrl.

It also adds simulation of missing Shift KEYUP events for Windows.
When multiple Shifts are held down at the same time, Windows natively
only sends a KEYUP for the last one to be released.
2024-01-26 14:42:28 +01:00
Yuri Sizov
2ababdcc06 Merge pull request #87324 from jsjtxietian/action-exist
Check action exists in `Input.action_press` and `action_release`
2024-01-18 19:27:06 +01:00
jsjtxietian
4b3a12f4ee Check action exists in Input.action_press and action_release 2024-01-18 16:18:16 +08:00
Rémi Verschelde
0a7579b161
Fix #if *_ENABLED inconsistencies, should check if defined
Co-authored-by: Caroline Joy Bell <halotroop2288@proton.me>
2024-01-17 10:30:15 +01:00
Rémi Verschelde
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
Micky
ca2f340384 Fix missing autocompletion for inheriting classes 2024-01-03 00:13:04 +01:00
Wilson E. Alvarez
a3cb1b096f
Add const references detected by clang-tidy 2023-12-16 13:36:44 -05:00
CaTaTo
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
Gilles Roudière
8cfcd36253 Rework action pressed state to support multiple controllers 2023-12-04 18:02:51 +01:00
kobewi
d9d0cfaf38 Rework input actions to be reliable 2023-11-10 15:24:04 +01:00
Rémi Verschelde
d3c0a7d598
Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@eb831f75ab

Fixes #83552.
2023-10-23 16:11:38 +02:00
Rémi Verschelde
e6e9b04aab
Merge pull request #81322 from johnnyw/android_fix_joypad_trigger_range
Android: Fix joypad trigger value range
2023-10-20 22:02:00 +02:00
John Watson
d413a02079 Android: Fix joypad trigger value range
`Input::joy_axis` converts trigger values to be between 0.0f to 1.0f by default. This is not needed for Android, as values are already within that range, as per Android documentation: https://developer.android.com/reference/android/view/MotionEvent#AXIS_RTRIGGER

This patch prevents this conversion on Android, which caused L2 and R2 triggers to get stuck pressed. https://github.com/godotengine/godot/issues/79263
2023-10-20 11:30:20 -07:00
ErezShahaf
ccb8ea613a
Fix Input.is_action_just_pressed flicker on joypad axes
Pressed tick assignments were in the wrong scope, resulting in updating
`pressed_frame` even when it shouldn't and therefore the `just_pressed`
would return true every time that the strength changes and not only when
there's a new valid press.

Fixes #81975.
2023-10-16 11:41:56 +02:00
Rémi Verschelde
0b4959bdf0
Merge pull request #82203 from KoBeWi/shortcuts_under_pressure
Make InputEventShortcut always pressed
2023-09-24 23:36:09 +02:00
Rémi Verschelde
e40b0b3ed8
Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@fc4b33c872
2023-09-24 15:51:12 +02:00
kobewi
90a0b19301 Make InputEventShortcut always pressed 2023-09-23 19:43:07 +02:00
Rémi Verschelde
5f5ca23586
Merge pull request #81170 from KoBeWi/step_input
Prevent axis-based actions from getting stuck
2023-09-11 15:37:42 +02:00
Rémi Verschelde
8de6405288
UWP: Remove platform port, needs to be redone from scratch for 4.x
The UWP platform port was never ported to the Godot 4.0+ API,
and it's now accumulating bitrot as it doesn't compile, and thus
we no longer propagate platform changes in it.

So we finally remove to acknowledge this state. There's still some
interest in reviving the UWP port eventually, especially as support
for Direct3D 12 will soon be merged, but when that happens it will
be easiest to redo it from scratch.
2023-09-07 15:01:59 +02:00
kobewi
a490fad82d Prevent axis-based actions from getting stuck 2023-09-04 15:47:26 +02:00
kobewi
5b95935e18 Remove debug print 2023-08-29 15:34:24 +02:00
Rémi Verschelde
76bc5a6554
Merge pull request #80859 from KoBeWi/prepare_for_action_and_make_it_double
Fix action state when multiple events are assigned
2023-08-29 15:06:02 +02:00
alcomposer
deaf6c3bb1
Context aware MIDI event printing 2023-08-28 12:42:15 +02:00
kobewi
ad1abca668 Fix action state when multiple events are assigned 2023-08-25 23:10:27 +02:00
Ricardo Subtil
1bb73b0689
Ensure joy_connection_changed is emitted on the main thread 2023-08-09 15:32:06 +01:00
Álex Román Núñez
3aa340d081 Add the ability to get per-platform information for joypads.
This adds the ability for games to obtain platform-specific information about joypads such as their vendor/product ID, their XInput gamepad index or the real name of the device before it gets swapped out by the gamecontrollerdb's name.

This PR also includes a rebased version of #76045, this is because this PR is intended to be mainly to help people implementing Steam Input, as having the gamepad index is essential.
2023-08-02 22:30:30 +02:00