diff --git a/modules/juce_gui_basics/buttons/juce_Button.cpp b/modules/juce_gui_basics/buttons/juce_Button.cpp index ac93013b6c..be7e55c5a2 100644 --- a/modules/juce_gui_basics/buttons/juce_Button.cpp +++ b/modules/juce_gui_basics/buttons/juce_Button.cpp @@ -572,7 +572,7 @@ void Button::clearShortcuts() bool Button::isShortcutPressed() const { - if (! isCurrentlyBlockedByAnotherModalComponent()) + if (isShowing() && ! isCurrentlyBlockedByAnotherModalComponent()) for (int i = shortcuts.size(); --i >= 0;) if (shortcuts.getReference(i).isCurrentlyDown()) return true;