JUCE flaw in plugin hosting applications

Here’s a small test project, which hosts plugins and writes on screen changing key press counter whenever a key has been pressed. Compile and run it to see how it works on your computer. Just right click with mouse to select/load a VST/AU plugin. Then click the plugin’s GUI area and start pressing computer keyboard keys. Let me know if it works on your computer. On mine I get no keyboard presses until I click outside the plugin GUI area.

VST_Host_Bugs.zip (11.3 KB)

All the keyboard handling happens in the MainComponent.cpp, if you’re interested in checking out what’s happening there.

Reuk said in another thread (VST3/AU plugin hosting bugs - demonstration project) :

I think that this is by design. If the plugin is focused, it gets to respond to key events first, and only unhandled key events should be passed up to the host.

Perhaps there’s scope for a new addGlobalKeyboardListener feature on juce::Desktop to mirror the existing addGlobalMouseListener - however, this would not be trivial to add and would require a lot of testing. I don’t see this happening in the near future as we’re currently focusing on other major features.