From 6911909c0ecb00576ffce220e86a64eae4f22bf4 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Sat, 20 Aug 2022 14:56:38 -0400 Subject: [PATCH 1/2] Modulation: Keybind to Arm and Restore Middle Mouse 1. Keybind CMD-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 --- src/surge-xt/gui/SurgeGUIEditor.cpp | 8 ++++++++ src/surge-xt/gui/SurgeGUIEditorKeyboardActions.h | 7 +++++++ src/surge-xt/gui/widgets/ModulationSourceButton.cpp | 5 +++++ 3 files changed, 20 insertions(+) diff --git a/src/surge-xt/gui/SurgeGUIEditor.cpp b/src/surge-xt/gui/SurgeGUIEditor.cpp index 50184279b03..13daae397e2 100644 --- a/src/surge-xt/gui/SurgeGUIEditor.cpp +++ b/src/surge-xt/gui/SurgeGUIEditor.cpp @@ -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::COMMAND, (int)'A'}); #if WINDOWS keyMapManager->addBinding(Surge::GUI::TOGGLE_DEBUG_CONSOLE, @@ -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(); diff --git a/src/surge-xt/gui/SurgeGUIEditorKeyboardActions.h b/src/surge-xt/gui/SurgeGUIEditorKeyboardActions.h index 424dfd2e769..b29306e1f1f 100644 --- a/src/surge-xt/gui/SurgeGUIEditorKeyboardActions.h +++ b/src/surge-xt/gui/SurgeGUIEditorKeyboardActions.h @@ -44,6 +44,7 @@ enum KeyboardActions // TODO: FIX SCENE ASSUMPTION TOGGLE_SCENE, + TOGGLE_MODULATOR_ARM, #if WINDOWS TOGGLE_DEBUG_CONSOLE, @@ -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: @@ -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"; diff --git a/src/surge-xt/gui/widgets/ModulationSourceButton.cpp b/src/surge-xt/gui/widgets/ModulationSourceButton.cpp index 11eccb61466..a763198b240 100644 --- a/src/surge-xt/gui/widgets/ModulationSourceButton.cpp +++ b/src/surge-xt/gui/widgets/ModulationSourceButton.cpp @@ -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; From 44414d5b9ad941ff13a5f0e25fee50e788d0b495 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Sat, 20 Aug 2022 15:05:55 -0400 Subject: [PATCH 2/2] Alt- not Command --- src/surge-xt/gui/SurgeGUIEditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/surge-xt/gui/SurgeGUIEditor.cpp b/src/surge-xt/gui/SurgeGUIEditor.cpp index 13daae397e2..3bad9ab47d2 100644 --- a/src/surge-xt/gui/SurgeGUIEditor.cpp +++ b/src/surge-xt/gui/SurgeGUIEditor.cpp @@ -6805,7 +6805,7 @@ 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::COMMAND, (int)'A'}); + {keymap_t::Modifiers::ALT, (int)'A'}); #if WINDOWS keyMapManager->addBinding(Surge::GUI::TOGGLE_DEBUG_CONSOLE,