hasKeyboardFocus() - Win vs. iOS


#1

Hi.

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?

Background:
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.

Thanks


#2

iOS? Surely you mean OSX?


#3

Yes, OSX, sorry…


#4

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.


#5

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.