summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/input/input_event.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp
index f421ecb22d..eb62367f3b 100644
--- a/core/input/input_event.cpp
+++ b/core/input/input_event.cpp
@@ -1408,7 +1408,18 @@ bool InputEventAction::action_match(const Ref<InputEvent> &p_event, bool p_exact
}
String InputEventAction::as_text() const {
- return vformat(RTR("Input Action %s was %s"), action, pressed ? "pressed" : "released");
+ const List<Ref<InputEvent>> *events = InputMap::get_singleton()->action_get_events(action);
+ if (!events) {
+ return String();
+ }
+
+ for (const Ref<InputEvent> &E : *events) {
+ if (E.is_valid()) {
+ return E->as_text();
+ }
+ }
+
+ return String();
}
String InputEventAction::to_string() {