hasKeyboardFocus() - Win vs. iOS


In Windows I know when the user has clicked outside my plugin using hasKeyboardFocus() on my main component.
In iOS, it seems that it doesn’t work this way.

“outside my window” = on the host window surrounding my plugin.

So how can I detect that in iOS?

I’m using a TopLevelWindow that covers my plugin to catch keystrokes, it does the job well.
I need to know when the user is clicking outside the plugin to set it invisible when not needed.


iOS? Surely you mean OSX?

Yes, OSX, sorry…

It looks like the focus stays inside the Juce components even when I’m clicking on the plugin host’s window and dragging it.
But when I’m clicking on another application, the focus goes away.

OSX is a bit problematic for focus info like that, especially inside a host - if it doesn’t get a focusLost callback then that’s probably because I couldn’t find a way to detect it.