summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor/project_settings_editor.cpp20
-rw-r--r--editor/settings_config_dialog.cpp10
2 files changed, 3 insertions, 27 deletions
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index f56f7ef7ca..ca5858b768 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -442,15 +442,7 @@ void ProjectSettingsEditor::_wait_for_key(const Ref<InputEvent> &p_event) {
if (k.is_valid() && k->is_pressed() && k->get_scancode() != 0) {
last_wait_for_key = p_event;
- String str = keycode_get_string(k->get_scancode()).capitalize();
- if (k->get_metakey())
- str = vformat("%s+", find_keycode_name(KEY_META)) + str;
- if (k->get_shift())
- str = TTR("Shift+") + str;
- if (k->get_alt())
- str = TTR("Alt+") + str;
- if (k->get_control())
- str = TTR("Control+") + str;
+ const String str = keycode_get_string(k->get_scancode_with_modifiers());
press_a_key_label->set_text(str);
press_a_key->accept_event();
@@ -740,15 +732,7 @@ void ProjectSettingsEditor::_update_actions() {
Ref<InputEventKey> k = event;
if (k.is_valid()) {
- String str = keycode_get_string(k->get_scancode()).capitalize();
- if (k->get_metakey())
- str = vformat("%s+", find_keycode_name(KEY_META)) + str;
- if (k->get_shift())
- str = TTR("Shift+") + str;
- if (k->get_alt())
- str = TTR("Alt+") + str;
- if (k->get_control())
- str = TTR("Control+") + str;
+ const String str = keycode_get_string(k->get_scancode_with_modifiers());
action2->set_text(0, str);
action2->set_icon(0, get_icon("Keyboard", "EditorIcons"));
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp
index f8425ebe22..a38c6b98cc 100644
--- a/editor/settings_config_dialog.cpp
+++ b/editor/settings_config_dialog.cpp
@@ -310,15 +310,7 @@ void EditorSettingsDialog::_wait_for_key(const Ref<InputEvent> &p_event) {
if (k.is_valid() && k->is_pressed() && k->get_scancode() != 0) {
last_wait_for_key = k;
- String str = keycode_get_string(k->get_scancode()).capitalize();
- if (k->get_metakey())
- str = vformat("%s+", find_keycode_name(KEY_META)) + str;
- if (k->get_shift())
- str = TTR("Shift+") + str;
- if (k->get_alt())
- str = TTR("Alt+") + str;
- if (k->get_control())
- str = TTR("Control+") + str;
+ const String str = keycode_get_string(k->get_scancode_with_modifiers());
press_a_key_label->set_text(str);
press_a_key->accept_event();