Don't handle property_editor shortcuts on release.

Fixes #52336.

EditorProperty::unhandled_key_input was handling both press and release.
This means that if you press `ctrl+v` on an EditorProperty line input,
it will paste as expected on pressing `ctrl+v`, and accept the event so
EditorProperty will not see it. However, on release, LineEdit ignores
the event and EditorProperty still catches and handles it, using its own
paste implementation.
This commit is contained in:
Ryan Roden-Corrent 2021-09-03 08:33:02 -04:00
parent d20031ccae
commit b296ad23b4
No known key found for this signature in database
GPG key ID: 435D8B10692555C9

View file

@ -799,6 +799,9 @@ void EditorProperty::unhandled_key_input(const Ref<InputEvent> &p_event) {
return;
}
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();
@ -810,6 +813,7 @@ void EditorProperty::unhandled_key_input(const Ref<InputEvent> &p_event) {
accept_event();
}
}
}
void EditorProperty::set_label_reference(Control *p_control) {
label_reference = p_control;