@@ -41,6 +41,9 @@ struct ConvolutionButton : public juce::Component
4141 SurgeGUIEditor *sge{nullptr };
4242 void setSurgeGUIEditor (SurgeGUIEditor *s) { sge = s; }
4343
44+ CurrentFxDisplay *cfxd{nullptr };
45+ void setCurrentFxDisplay (CurrentFxDisplay *p) { cfxd = p; }
46+
4447 ConvolutionEffect *fx{nullptr };
4548 FxStorage *fxs{nullptr };
4649 int slot{-1 };
@@ -388,6 +391,10 @@ struct ConvolutionButton : public juce::Component
388391 }
389392 sge->synth ->fx_reload [slot] = true ;
390393 sge->synth ->load_fx_needed = true ;
394+
395+ if (cfxd)
396+ cfxd->had_focus = true ;
397+
391398 return true ;
392399 }
393400};
@@ -398,6 +405,7 @@ CurrentFxDisplay::CurrentFxDisplay(SurgeGUIEditor *e)
398405{
399406 editor_ = e;
400407 storage = e->getStorage ();
408+ had_focus = false ;
401409}
402410
403411CurrentFxDisplay::~CurrentFxDisplay () {}
@@ -587,6 +595,7 @@ void CurrentFxDisplay::convolutionLayout()
587595 // button->setWantsKeyboardFocus(true);
588596 button->setStorage (storage);
589597 button->setSurgeGUIEditor (editor_);
598+ button->setCurrentFxDisplay (this );
590599 button->setEffect (&fx, &storage->getPatch ().fx [current_fx_], current_fx_);
591600 button->setBounds (vr);
592601 auto ol = std::make_unique<OverlayAsAccessibleButton<ConvolutionButton>>(
@@ -601,6 +610,7 @@ void CurrentFxDisplay::convolutionLayout()
601610 }
602611 ol->setTitle (irname);
603612 ol->setDescription (irname);
613+ ol->setHelpText (" Impulse Response Loader Menu" );
604614
605615 ol->onPress = [this ](ConvolutionButton *c) { c->showIRMenu (); };
606616 ol->onMenuKey = [this ](ConvolutionButton *c) {
@@ -611,6 +621,12 @@ void CurrentFxDisplay::convolutionLayout()
611621 menu = std::move (ol);
612622 menu->setBounds (vr);
613623 editor_->addAndMakeVisibleWithTracking (this , *menu);
624+
625+ if (had_focus)
626+ {
627+ menu->grabKeyboardFocus ();
628+ had_focus = false ;
629+ }
614630}
615631
616632void CurrentFxDisplay::conditionerRender ()
0 commit comments