I wonder how to properly capture the keys from a plugin window, so the plugin host application receives them as if they were pressed in there (For instance, when I press CTRL+Z when the plugin window is focused, this should still provoke the ApplicationCommand “Undo” in the plugin host app).
So far, what I found out is:
- It is possible to receive KeyPresses via ThePluginWindow::keyPressed(), but funnily enough this only works after opening the plugin window, then clicking the host app so it gets focused, then clicking back on the plugin window so it gets focused back again.
- I forward the KeyPress to the app’s MainComponent, but then I don’t know what to do. I would like the KeyPress handling to be as if the key was pressed in the app, but calling Component::getPeer()->handleKeyPress() results in a stack overflow. I don’t know what’s the proper way to do this.
Any help appreciated!