From 6c65c866690b9ed690ad36b5975f06dec666b1cb Mon Sep 17 00:00:00 2001 From: Estelle Linkpy Reid Date: Sat, 2 Jul 2022 15:34:15 +0200 Subject: [PATCH] Corrected InputEventKey::as_text to return a non-empty string for physical keys. --- core/os/input_event.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index cd43cffdd..f94069dd9 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -268,7 +268,14 @@ uint32_t InputEventKey::get_physical_scancode_with_modifiers() const { } String InputEventKey::as_text() const { - String kc = keycode_get_string(scancode); + String kc; + + if (scancode == 0) { + kc = keycode_get_string(physical_scancode) + " (" + RTR("Physical") + ")"; + } else { + kc = keycode_get_string(scancode); + } + if (kc == String()) { return kc; }