- Home /
Keyboard not getting focus back on IE9
Hey guys,
I keep having a very inconsistent issue which is quite problematic for our game.
When a user runs our webplayer game, as soon as he logins he gets an automatic fullscreen. He then can either use the ESC key or our own gui button to go back to browser screen mode.
In IE9 (possibly IE8 too), once I go back to browser mode, it causes a very annoying issue:
The keyboard loses focus and the user can not use the keyboard to move (he has no other way to move). GUI events are still active and still list keyboard actions, but Input.GetAxisRaw and Input.GetButtonDown do not function.
That would not be catastrophy if by clicking the unity window, the user could have taken focus back and move again (considering I have OnApplicationFocus to identify such cases and print a message). But in IE9 - this does not work. Sometimes by clicking outside the unity screen and then clicking inside again, I get the focus back, but most of the times, even that does not help, and for some very weird reason, if I follow these steps a few times, at some point the focus "magically" gets back to the unity screen.
The whole behavior is inconsistent. Within the log file I get the following message which might suggest some issue:
web: toggle fullscreen
Skipped rendering frame because GfxDevice is in invalid state (device lost)
NOTE: In the latest chrome it works perfect. Focus does not even get lost and I don't even have to click the unity screen to get it back. In IE6 as well.. In the latest firefox I do need to click the unity screen, but at least it is consistent and always works so I get the focus back.
Anyone has any clue what's going on?
I now also found, that if I press a keyboard key before doing the click outside the unity window and then a click in unity window - I always get the focus back.
Your answer
![](https://koobas.hobune.stream/wayback/20220612202922im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Going full screen (no, really full screen) with Web Player 3 Answers
Web player : fullscreen : ready for primetime? 0 Answers
Full Screen Web Player? 7 Answers