summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/graph_edit.cpp30
1 files changed, 23 insertions, 7 deletions
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp
index f238aeb392..38005f1322 100644
--- a/scene/gui/graph_edit.cpp
+++ b/scene/gui/graph_edit.cpp
@@ -1030,14 +1030,28 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
}
Ref<InputEventKey> k = p_ev;
- if (k.is_valid() && k->get_scancode() == KEY_D && k->is_pressed() && k->get_command()) {
- emit_signal("duplicate_nodes_request");
- accept_event();
- }
- if (k.is_valid() && k->get_scancode() == KEY_DELETE && k->is_pressed()) {
- emit_signal("delete_nodes_request");
- accept_event();
+ if (k.is_valid()) {
+
+ if (k->get_scancode() == KEY_D && k->is_pressed() && k->get_command()) {
+ emit_signal("duplicate_nodes_request");
+ accept_event();
+ }
+
+ if (k->get_scancode() == KEY_C && k->is_pressed() && k->get_command()) {
+ emit_signal("copy_nodes_request");
+ accept_event();
+ }
+
+ if (k->get_scancode() == KEY_V && k->is_pressed() && k->get_command()) {
+ emit_signal("paste_nodes_request");
+ accept_event();
+ }
+
+ if (k->get_scancode() == KEY_DELETE && k->is_pressed()) {
+ emit_signal("delete_nodes_request");
+ accept_event();
+ }
}
Ref<InputEventMagnifyGesture> magnify_gesture = p_ev;
@@ -1297,6 +1311,8 @@ void GraphEdit::_bind_methods() {
ADD_SIGNAL(MethodInfo("disconnection_request", PropertyInfo(Variant::STRING, "from"), PropertyInfo(Variant::INT, "from_slot"), PropertyInfo(Variant::STRING, "to"), PropertyInfo(Variant::INT, "to_slot")));
ADD_SIGNAL(MethodInfo("popup_request", PropertyInfo(Variant::VECTOR2, "position")));
ADD_SIGNAL(MethodInfo("duplicate_nodes_request"));
+ ADD_SIGNAL(MethodInfo("copy_nodes_request"));
+ ADD_SIGNAL(MethodInfo("paste_nodes_request"));
ADD_SIGNAL(MethodInfo("node_selected", PropertyInfo(Variant::OBJECT, "node", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
ADD_SIGNAL(MethodInfo("connection_to_empty", PropertyInfo(Variant::STRING, "from"), PropertyInfo(Variant::INT, "from_slot"), PropertyInfo(Variant::VECTOR2, "release_position")));
ADD_SIGNAL(MethodInfo("connection_from_empty", PropertyInfo(Variant::STRING, "to"), PropertyInfo(Variant::INT, "to_slot"), PropertyInfo(Variant::VECTOR2, "release_position")));