Skip to content

Commit

Permalink
ESC closes overlays in zorder if non torn out (#5235)
Browse files Browse the repository at this point in the history
Closes #5221
  • Loading branch information
baconpaul authored Oct 12, 2021
1 parent 3dbaa1f commit 3ebc682
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/surge-xt/gui/SurgeGUIEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5525,6 +5525,25 @@ bool SurgeGUIEditor::keyPressed(const juce::KeyPress &key, juce::Component *orig
return true;
}

if (key.getKeyCode() == juce::KeyPress::escapeKey)
{
Surge::Overlays::OverlayWrapper *topOverlay{nullptr};

for (auto c : frame->getChildren())
{
auto q = dynamic_cast<Surge::Overlays::OverlayWrapper *>(c);
if (q)
{
topOverlay = q;
}
}
if (topOverlay)
{
topOverlay->onClose();
return true;
}
}

if (getUseKeyboardShortcuts())
{
// zoom actions
Expand Down

0 comments on commit 3ebc682

Please sign in to comment.