summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-09-16 13:25:44 +0200
committerGitHub <noreply@github.com>2021-09-16 13:25:44 +0200
commiteca594d25ed959b32aa9671e5091dd80105ce349 (patch)
tree67f6b539c2d9772cc9e8ae77d7e15a827ce81aee
parent879ce4c6e1dbc7f9ad5bdb83b90b92be4f94b7f6 (diff)
parentb296ad23b454c7ce92b819d4a5627d3c7bd8963d (diff)
Merge pull request #52376 from rcorre/prop_path_copy_fix
Don't handle property_editor shortcuts on release.
-rw-r--r--editor/editor_inspector.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 7631e425e8..4832cd6994 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -803,15 +803,19 @@ void EditorProperty::unhandled_key_input(const Ref<InputEvent> &p_event) {
return;
}
- if (ED_IS_SHORTCUT("property_editor/copy_property", p_event)) {
- menu_option(MENU_COPY_PROPERTY);
- accept_event();
- } else if (ED_IS_SHORTCUT("property_editor/paste_property", p_event) && !is_read_only()) {
- menu_option(MENU_PASTE_PROPERTY);
- accept_event();
- } else if (ED_IS_SHORTCUT("property_editor/copy_property_path", p_event)) {
- menu_option(MENU_COPY_PROPERTY_PATH);
- accept_event();
+ const Ref<InputEventKey> k = p_event;
+
+ if (k.is_valid() && k->is_pressed()) {
+ if (ED_IS_SHORTCUT("property_editor/copy_property", p_event)) {
+ menu_option(MENU_COPY_PROPERTY);
+ accept_event();
+ } else if (ED_IS_SHORTCUT("property_editor/paste_property", p_event) && !is_read_only()) {
+ menu_option(MENU_PASTE_PROPERTY);
+ accept_event();
+ } else if (ED_IS_SHORTCUT("property_editor/copy_property_path", p_event)) {
+ menu_option(MENU_COPY_PROPERTY_PATH);
+ accept_event();
+ }
}
}