We are having problems with keyboard focus when a 3rd party hosted plugin’s GUI is focused. We have tried setting the Plugin editor requires keyboard focus to false and have tried to implement this independently with the following
PluginWindow::~PluginWindow()
{
if (isActiveWindow()) {
setWantsKeyboardFocus(false);
DocumentWindow::setWantsKeyboardFocus(false);
}
}
}
But none of these have worked, the focused window still steals keyboard focus, which is preventing Spacebar playback in the DAW whilst the 3rd party plugin GUI is focused.
Thanks for your answer.
I am trying your proposal now. and keep you updated.
Additional question:
When i press space bar on the main plugin window, i dont see the plugin handle the key pressed handler.
I just need to play track on DAWs.
Is there a way to do that ?
If your application is a plug-in host then the above approach may work. If, however, you are trying to send a spacebar press to an external host from inside a plug-in GUI then I don’t know what will work; it’s the host’s responsibility to capture key presses it might be interested in.
Tom already looked into this, and like he says, it’s not something we consider to be working incorrectly. Hosts generally use some hacky tricks to spy on keypresses that happen inside your plugin window, but if you start creating your own separate windows, you can’t expect the host to pay any attention to them.
All I can suggest would be that you catch spacebar presses yourself in your floating window, and then write your own win32 code to inject space key events into your plugin’s HWND, so that host may spot them.