- Home /
OnApplicationFocus called twice - need to stop input
I'm close to finishing an application, however I'm hitting up against a certain road block.
This application has "Run in Background" set to True, only because I want to make sure various calculations are being run (including a few threaded async operations) while the app doesn't have focus. However, I've found that even if the Standalone doesn't have focus, it's still grabbing mouse input.
I swore I implemented OnApplicationFocus
to fix that, so I added a line to let me see the "focus" status of the application. Turns out it loses focus for at most a few frames before OnApplicationFocus(true)
is called.
I've just filed a bug report for it, but I'm not entirely certain that's gonna help it - I still have pending issues from a long while ago they haven't said anything about.
Does anyone have any idea how to get around this particular conundrum? I need to stop both uGUI events as well as Input
events when the thing loses focus, without resorting to disabling "Run in Background". I've been able to stop events from occurring should the mouse leave the window, but if something's laid overtop the app's window, then any input on the upper window filters through and ends up affecting the application.
Your answer
Follow this Question
Related Questions
Can an Input event be 'faked' with a script? 1 Answer
Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers
Mac Keys not showing up, or very strangely... 2 Answers
Detect Ctrl+LMB on a rect in edit mode? 1 Answer
Mouse Cursor Hidden, Won't Come Back on Pause/Focus 2 Answers