summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Brummer <mbrlabs7@gmail.com>2022-02-11 11:36:47 +0100
committerMarcus Brummer <mbrlabs7@gmail.com>2022-02-11 11:41:51 +0100
commit55fda17742f85309aba5a60a2a969a5565d944b9 (patch)
treed08db0b7f36a9ea9e44e653398d6e2ee3f39a17a
parent3aa7b7eaf2c24cc3e91d6a4155c0d6bdce88d91b (diff)
Deselect nodes in the 3D editor when pressing ESC
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 5f58724594..3fdf4579ff 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -1888,7 +1888,12 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
}
}
- if (_edit.mode != TRANSFORM_NONE) {
+ if (_edit.mode == TRANSFORM_NONE) {
+ if (k->get_keycode() == Key::ESCAPE && !cursor.region_select) {
+ _clear_selected();
+ return;
+ }
+ } else {
// We're actively transforming, handle keys specially
TransformPlane new_plane = TRANSFORM_VIEW;
String new_message;