summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-12-03 08:23:25 +0100
committerGitHub <noreply@github.com>2020-12-03 08:23:25 +0100
commita5fa9199efe0943bc8e852ca300bbc3cd33b25af (patch)
tree0cbb5150a7b993743998869fe616283e88c7722e
parent2a0de6d88cfdc7cbd42e448fd44f1fbc438b320c (diff)
parent5a3952fe6476f0d012560bfbd1fc590c48e0511d (diff)
Merge pull request #44051 from EricEzaM/PR/rename-files-with-F2-key
Added F2 shortcuts for renaming files & folders.
-rw-r--r--editor/filesystem_dock.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index c65c796e5e..3d5da5f68f 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -2511,7 +2511,11 @@ void FileSystemDock::_tree_gui_input(Ref<InputEvent> p_event) {
_tree_rmb_option(FILE_REMOVE);
} else if (ED_IS_SHORTCUT("filesystem_dock/rename", p_event)) {
_tree_rmb_option(FILE_RENAME);
+ } else {
+ return;
}
+
+ accept_event();
}
}
@@ -2526,7 +2530,11 @@ void FileSystemDock::_file_list_gui_input(Ref<InputEvent> p_event) {
_file_list_rmb_option(FILE_REMOVE);
} else if (ED_IS_SHORTCUT("filesystem_dock/rename", p_event)) {
_file_list_rmb_option(FILE_RENAME);
+ } else {
+ return;
}
+
+ accept_event();
}
}
@@ -2683,7 +2691,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) {
ED_SHORTCUT("filesystem_dock/copy_path", TTR("Copy Path"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_C);
ED_SHORTCUT("filesystem_dock/duplicate", TTR("Duplicate..."), KEY_MASK_CMD | KEY_D);
ED_SHORTCUT("filesystem_dock/delete", TTR("Delete"), KEY_DELETE);
- ED_SHORTCUT("filesystem_dock/rename", TTR("Rename"));
+ ED_SHORTCUT("filesystem_dock/rename", TTR("Rename"), KEY_F2);
VBoxContainer *top_vbc = memnew(VBoxContainer);
add_child(top_vbc);