[4.8.3] How can I check if the game window is unfocused?

I want to run some custom code when the game window is unfocused.

How would I check for this, and where/what files is this handled so I can hook into it?

I found FApp when I was looking into the UnfocusedVolumeMultiplier, but nothing there seems to actually handle when the window becomes unfocused.