- Home /
How can I tell when the Unity window is inactive?
When the Unity web player is a background window, Input.GetMouseButtonDown are still received. In other words, mouse clicks are handled even if another window is in front of the web page hosting the web player.
Is there any way to tell if the Unity window is currently selected?
Note that I do not want to disable the window when it is background, and I mean the main Unity window, and not GUI window controls.
Answer by jashan · Jul 30, 2010 at 06:29 PM
You could try this forum posting for a start: Knowing when a web game loses focus
It's not trivial and does involve some JavaScript coding ("the real JavaScript" in the browser, not UnityScript) and it seems this doesn't work in all cases - but it certainly is a good point to start from.
Your answer
![](https://koobas.hobune.stream/wayback/20220613070118im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Color custom editor window ? 2 Answers
Drag Drop and Audio 0 Answers
Editor Window Update 1 Answer
Border around webplayer window? 2 Answers