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?

Did you ever solve this problem?

I’ve been getting exactly the same issue.

This is still happening on a client’s Win7 laptop with IE8 too. Serious issue. Any advice anybody? Setting Run In Background didn’t help.

It seems like IE grabs focus away from the page to the app bar every time I click on the game screen. Scrolling the page and clicking back on the game regains focus.

My Win7 with IE10 seems fine.