Skip to content

Commit

Permalink
Merge pull request #2029 from alcomposer/escape-command-input
Browse files Browse the repository at this point in the history
Allow esc to exit command input if all objects deselected
  • Loading branch information
timothyschoen authored Dec 27, 2024
2 parents d27793b + 6f94d4d commit 3a3020d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Source/Sidebar/CommandInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -790,9 +790,14 @@ class CommandInput final
return true;
}
if (key.getKeyCode() == KeyPress::escapeKey) {
if (auto* cnv = editor->getCurrentCanvas())
if (auto* cnv = editor->getCurrentCanvas()) {
if (cnv->selectedComponents.getNumSelected() == 0) {
editor->commandManager.invokeDirectly(CommandIDs::ShowCommandInput, false);
return true;
}
cnv->deselectAll();
updateCommandInputTarget();
updateCommandInputTarget();
}
return true;
}
if (key.getKeyCode() == KeyPress::spaceKey) {
Expand Down

0 comments on commit 3a3020d

Please sign in to comment.