I have a plugin with a bunch of buttons and a list view.
When the buttons are pushed I want the list view to lose keyboard focus, but I don’t want the buttons to gain keyboard focus (because they soak up the enter key which annoys Cubase users).
setWantsKeyboardFocus (false) was the start of my problems.
However if i put in my AudioProcessorEditor constructor setWantsKeyboardFocus(true) and then in the focusGained() override unfocusAllComponents() then we get the right behaviour at the expense of lots of calls to focus and unfocus everytime anything is clicked on.
void focusGained (FocusChangeType) override
{
// back stop so clicking on anything that doesn't have keyboard focus specifically enabled
// defocuses everything
unfocusAllComponents();
}