diff --git a/src/surge-xt/gui/SurgeGUIEditor.cpp b/src/surge-xt/gui/SurgeGUIEditor.cpp index dc38c569f3f..feabb5dfb00 100644 --- a/src/surge-xt/gui/SurgeGUIEditor.cpp +++ b/src/surge-xt/gui/SurgeGUIEditor.cpp @@ -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(c); + if (q) + { + topOverlay = q; + } + } + if (topOverlay) + { + topOverlay->onClose(); + return true; + } + } + if (getUseKeyboardShortcuts()) { // zoom actions