Skip to content

Commit 6f94d4d

Browse files
author
alcomposer
committed
Allow esc to exit command input if all objects deselected
1 parent aa8ec6f commit 6f94d4d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Source/Sidebar/CommandInput.h

+7-2
Original file line numberDiff line numberDiff line change
@@ -790,9 +790,14 @@ class CommandInput final
790790
return true;
791791
}
792792
if (key.getKeyCode() == KeyPress::escapeKey) {
793-
if (auto* cnv = editor->getCurrentCanvas())
793+
if (auto* cnv = editor->getCurrentCanvas()) {
794+
if (cnv->selectedComponents.getNumSelected() == 0) {
795+
editor->commandManager.invokeDirectly(CommandIDs::ShowCommandInput, false);
796+
return true;
797+
}
794798
cnv->deselectAll();
795-
updateCommandInputTarget();
799+
updateCommandInputTarget();
800+
}
796801
return true;
797802
}
798803
if (key.getKeyCode() == KeyPress::spaceKey) {

0 commit comments

Comments
 (0)