Deselect nodes in the 3D editor when pressing ESC

This commit is contained in:
Marcus Brummer 2022-02-17 19:43:35 +01:00
parent 47e34dc4e2
commit 67b879edbd

View File

@ -2030,6 +2030,13 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
return;
}
if (_edit.mode == TRANSFORM_NONE && !cursor.region_select) {
if (k->get_scancode() == KEY_ESCAPE) {
_clear_selected();
return;
}
}
if (EditorSettings::get_singleton()->get("editors/3d/navigation/emulate_numpad")) {
const uint32_t code = k->get_scancode();
if (code >= KEY_0 && code <= KEY_9) {