diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-11-16 09:29:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-16 09:29:04 +0100 |
commit | a6150eb2678f32b1e07550a81097d6973fc7ad5d (patch) | |
tree | b9e52f68d451a8136b56e7383ee46ec410e3a9ad /core/input | |
parent | 91dd6da2ffceb10d768fdd4be4b11c2c31f0b0c8 (diff) | |
parent | b7c612bd54cd1b1a9e8285f736f41c8a9dc4a2e2 (diff) |
Merge pull request #43289 from KoBeWi/removelease_action
Release pressed action if event is removed
Diffstat (limited to 'core/input')
-rw-r--r-- | core/input/input_map.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/input/input_map.cpp b/core/input/input_map.cpp index ba1de3c58d..a416048367 100644 --- a/core/input/input_map.cpp +++ b/core/input/input_map.cpp @@ -31,6 +31,7 @@ #include "input_map.h" #include "core/config/project_settings.h" +#include "core/input/input.h" #include "core/os/keyboard.h" InputMap *InputMap::singleton = nullptr; @@ -145,6 +146,9 @@ void InputMap::action_erase_event(const StringName &p_action, const Ref<InputEve List<Ref<InputEvent>>::Element *E = _find_event(input_map[p_action], p_event); if (E) { input_map[p_action].inputs.erase(E); + if (Input::get_singleton()->is_action_pressed(p_action)) { + Input::get_singleton()->action_release(p_action); + } } } |