diff --git a/src/surge-xt/gui/widgets/OscillatorWaveformDisplay.cpp b/src/surge-xt/gui/widgets/OscillatorWaveformDisplay.cpp index 10f65a1d9c9..3b77d97c31c 100644 --- a/src/surge-xt/gui/widgets/OscillatorWaveformDisplay.cpp +++ b/src/surge-xt/gui/widgets/OscillatorWaveformDisplay.cpp @@ -98,7 +98,7 @@ OscillatorWaveformDisplay::OscillatorWaveformDisplay() ol = std::make_unique>( this, customEditor ? "Close Custom Editor" : "Open Custom Editor", juce::AccessibilityRole::button); - + ol->setWantsKeyboardFocus(true); addChildComponent(*ol); ol->onPress = [this](OscillatorWaveformDisplay *d) { @@ -115,6 +115,21 @@ OscillatorWaveformDisplay::OscillatorWaveformDisplay() d->customEditorAccOverlay->setTitle("Open Custom Editor"); } }; + ol->onReturnKey = [this](OscillatorWaveformDisplay *d) { + if (customEditor) + { + hideCustomEditor(); + d->customEditorAccOverlay->setDescription("Close Custom Editor"); + d->customEditorAccOverlay->setTitle("Close Custom Editor"); + } + else + { + showCustomEditor(); + d->customEditorAccOverlay->setDescription("Open Custom Editor"); + d->customEditorAccOverlay->setTitle("Open Custom Editor"); + } + return true; + }; customEditorAccOverlay = std::move(ol); } @@ -403,7 +418,13 @@ void OscillatorWaveformDisplay::resized() menuOverlays[2]->setBounds(rightJog.toNearestInt()); waveTableName = wtr.withTrimmedRight(wtbheight).withTrimmedLeft(wtbheight); menuOverlays[0]->setBounds(waveTableName.toNearestInt()); - customEditorAccOverlay->setBounds(wtl.toNearestInt()); + + customEditorBox = getLocalBounds() + .withTop(getHeight() - wtbheight) + .withRight(60) + .withTrimmedBottom(1) + .toFloat(); + customEditorAccOverlay->setBounds(customEditorBox.toNearestInt()); } void OscillatorWaveformDisplay::repaintIfIdIsInRange(int id) @@ -1579,6 +1600,11 @@ struct AliasAdditiveEditor : public juce::Component, repaint(); }; + q->onMenuKey = [this](auto *t) { + parent->createAliasOptionsMenu(); + return true; + }; + addAndMakeVisible(*q); sliderAccOverlays[i] = std::move(q); diff --git a/src/surge-xt/gui/widgets/OscillatorWaveformDisplay.h b/src/surge-xt/gui/widgets/OscillatorWaveformDisplay.h index dd5fe009dfa..f1d6031e518 100644 --- a/src/surge-xt/gui/widgets/OscillatorWaveformDisplay.h +++ b/src/surge-xt/gui/widgets/OscillatorWaveformDisplay.h @@ -23,6 +23,7 @@ #include "juce_gui_basics/juce_gui_basics.h" #include "Oscillator.h" +#include "AccessibleHelpers.h" class SurgeStorage; class SurgeGUIEditor;