From e7a9ed2a257ffe6492eff81ddca39f72ad4b3050 Mon Sep 17 00:00:00 2001 From: Joep Vanlier Date: Sat, 7 Dec 2024 21:42:21 +0100 Subject: [PATCH] plugin: forward more keys --- plugin/components/graphics_view.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugin/components/graphics_view.cpp b/plugin/components/graphics_view.cpp index a8b9ea8..7b1519c 100644 --- a/plugin/components/graphics_view.cpp +++ b/plugin/components/graphics_view.cpp @@ -327,6 +327,13 @@ bool YsfxGraphicsView::keyPressed(const juce::KeyPress &key) // Pass escape through so users can close the plugin if (key.getKeyCode() == key.escapeKey) return false; + // Pass space through so users can change transport state + if (key.getKeyCode() == key.spaceKey) return false; + + // Pass modifier-based key combos through + juce::ModifierKeys mods = key.getModifiers(); + if (mods.isCtrlDown() || mods.isCommandDown()) return false; + return true; } @@ -351,6 +358,10 @@ bool YsfxGraphicsView::keyStateChanged(bool isKeyDown) } } + // Make sure modifier-based key combos are not lost + juce::ModifierKeys mods = juce::ModifierKeys::getCurrentModifiers(); + if (mods.isCtrlDown() || mods.isCommandDown()) return false; + return true; }