Skip to content

Commit

Permalink
Modulation: Keybind to Arm and Restore Middle Mouse (#6550)
Browse files Browse the repository at this point in the history
* Modulation: Keybind to Arm and Restore Middle Mouse

1. Keybind Alt/Opt+A toggles modulation
2. The middle mouse button forward-to-main-frame wasn't in
   ModulationSourceButton so that command selected and armed
   which wasn't desired.

Closes #6549
  • Loading branch information
baconpaul authored Aug 20, 2022
1 parent 25d39a0 commit 6e7708e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/surge-xt/gui/SurgeGUIEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6804,6 +6804,8 @@ void SurgeGUIEditor::setupKeymapManager()

// TODO: FIX SCENE ASSUMPTION
keyMapManager->addBinding(Surge::GUI::TOGGLE_SCENE, {keymap_t::Modifiers::ALT, (int)'S'});
keyMapManager->addBinding(Surge::GUI::TOGGLE_MODULATOR_ARM,
{keymap_t::Modifiers::ALT, (int)'A'});

#if WINDOWS
keyMapManager->addBinding(Surge::GUI::TOGGLE_DEBUG_CONSOLE,
Expand Down Expand Up @@ -6978,6 +6980,12 @@ bool SurgeGUIEditor::keyPressed(const juce::KeyPress &key, juce::Component *orig
return true;
}

case Surge::GUI::TOGGLE_MODULATOR_ARM:
{
toggle_mod_editing();
return true;
}

#if WINDOWS
case Surge::GUI::TOGGLE_DEBUG_CONSOLE:
Surge::Debug::toggleConsole();
Expand Down
7 changes: 7 additions & 0 deletions src/surge-xt/gui/SurgeGUIEditorKeyboardActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ enum KeyboardActions

// TODO: FIX SCENE ASSUMPTION
TOGGLE_SCENE,
TOGGLE_MODULATOR_ARM,

#if WINDOWS
TOGGLE_DEBUG_CONSOLE,
Expand Down Expand Up @@ -108,6 +109,8 @@ inline std::string keyboardActionName(KeyboardActions a)
// TODO: FIX SCENE ASSUMPTION
case TOGGLE_SCENE:
return "TOGGLE_SCENE";
case TOGGLE_MODULATOR_ARM:
return "TOGGLE_MODULATOR_ARM";

#if WINDOWS
case TOGGLE_DEBUG_CONSOLE:
Expand Down Expand Up @@ -213,6 +216,10 @@ inline std::string keyboardActionDescription(KeyboardActions a)
desc = "Toggle Scene A/B";
break;

case TOGGLE_MODULATOR_ARM:
desc = "Toggle Modulator Armed State";
break;

#if WINDOWS
case TOGGLE_DEBUG_CONSOLE:
desc = "Debug Console";
Expand Down
5 changes: 5 additions & 0 deletions src/surge-xt/gui/widgets/ModulationSourceButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,11 @@ void ModulationSourceButton::buildHamburgerMenu(juce::PopupMenu &menu,

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

mouseMode = CLICK;
everDragged = false;
mouseDownLocation = event.position;
Expand Down

0 comments on commit 6e7708e

Please sign in to comment.