Skip to content

Commit

Permalink
plugin: forward more keys
Browse files Browse the repository at this point in the history
  • Loading branch information
JoepVanlier committed Dec 8, 2024
1 parent 573bb9b commit b6ab78d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions plugin/components/graphics_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit b6ab78d

Please sign in to comment.