Okay, another quick-o thing that is probably from my desire to have my app easy to port to VST.
I have the “addKeyListener (commandManager->getKeyMappings ())” call happen in my MainComponent constructor. This works fine if I have clicked in the MainComponent area, but if I have, for example, maximised the window (and thus given the MainAppWindow focus), the key commands don’t work til i’ve clicked the main component.
This makes sense of course, as i’ve not given the keypresses to the top level window. I don’t want to have to keep stuff in the top level window though- as a VST plugin, the JuceAudioPlugin isn’t responsible for providing a TopLevelWindow, right? I tried to change it to
getTopLevelComponent ()->addKeyListener (commandManager->getKeyMappings ());
… expecting it to find the top level window (if there is one), but the same problem happens - clicking the title bar removes the shortcut key detection.
aren’t i a trouble maker today!