Skip to content

Commit

Permalink
LastChance forwarding for Middle Button
Browse files Browse the repository at this point in the history
  • Loading branch information
baconpaul committed Aug 28, 2021
1 parent b3e867d commit 0d06d7c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gui/widgets/ModulatableSlider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,11 @@ void ModulatableSlider::mouseDrag(const juce::MouseEvent &event)

void ModulatableSlider::mouseDown(const juce::MouseEvent &event)
{
if (forwardedMainFrameMouseDowns(event))
{
return;
}

if (event.mods.isPopupMenu())
{
editTypeWas = NOEDIT;
Expand Down
13 changes: 13 additions & 0 deletions src/gui/widgets/WidgetBaseMixin.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "juce_gui_basics/juce_gui_basics.h"

#include <unordered_set>
#include "MainFrame.h"

class SurgeGUIEditor;

Expand Down Expand Up @@ -124,6 +125,18 @@ struct WidgetBaseMixin : public Surge::GUI::SkinConsumingComponent,
}
return nullptr;
}

bool forwardedMainFrameMouseDowns(const juce::MouseEvent &e)
{
if (e.mods.isMiddleButtonDown())
{
auto sge = firstListenerOfType<SurgeGUIEditor>();
if (sge && sge->frame)
sge->frame->mouseDown(e);
return true;
}
return false;
}
};
} // namespace Widgets
} // namespace Surge
Expand Down

0 comments on commit 0d06d7c

Please sign in to comment.