mirror of https://github.com/godotengine/godot
Added additional param to action related methods to test for exactness.
If "p_exact_match" is true, then the action will only be "matched" if the provided input event *exactly* matches with the action event.
Before:
* Action Event = KEY_S
* Input Event = KEY_CONTROL + KEY_S
* Is Action Pressed = True
Now:
You can still do the above, however you can optionally check that the input is exactly what the action event is:
* Action Event = KEY_S
* Input Event = KEY_CONTROL + KEY_S
* p_exact_match = True
* Is Action Pressed = False
* If the Input Event was only KEY_S, then the result would be true.
Usage:
```gdscript
Input.is_action_pressed(action_name: String, exact_match: bool)
Input.is_action_pressed("my_action", true)
InputMap.event_is_action(p_event, "my_action", true)
func _input(event: InputEvent):
event.is_action_pressed("my_action", false, true) # false = "allow_echo", true = "exact_match"
event.is_action("my_action", true)
```
|
||
|---|---|---|
| .. | ||
| config | ||
| crypto | ||
| debugger | ||
| error | ||
| input | ||
| io | ||
| math | ||
| object | ||
| os | ||
| string | ||
| templates | ||
| variant | ||
| SCsub | ||
| core_bind.cpp | ||
| core_bind.h | ||
| core_builders.py | ||
| core_constants.cpp | ||
| core_constants.h | ||
| core_string_names.cpp | ||
| core_string_names.h | ||
| doc_data.cpp | ||
| doc_data.h | ||
| register_core_types.cpp | ||
| register_core_types.h | ||
| typedefs.h | ||
| version.h | ||