x


Web Player ignore input if doesn't have focus

Is there a way to keep a game running in the background, but have it ignore user input? I.e. is there a flag that I can check whether the game has focus or not? Or some other mechanism to achieve this?

This actually seems to work okay everywhere except OS X on Safari.

Thanks

more ▼

asked Dec 07 '10 at 08:43 AM

luqui gravatar image

luqui
62 7 7 14

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first
more ▼

answered Dec 07 '10 at 12:17 PM

Statement gravatar image

Statement ♦♦
20.1k 35 70 175

(comments are locked)
10|3000 characters needed characters left

I had some focus problems on Mac today: Unity didn't register mouse down events on the left 2/3rds of the screen (though registered mouse moves normally).

Though it previously worked well, it started (I guess) with a new player version.

The problem was me messing with DIVs on the HTML page while Unity was loading (showing the alternative content when no player installed etc.) So, if you got focus problems, it might be because of your custom host page!

Also, use always the latest version of UnityObject.js, e.g. always like to the online version of the script (on Unity servers), because Unity team could update the script to make it work with a new player version.

more ▼

answered Aug 18 '12 at 02:34 AM

dkozar gravatar image

dkozar
31 2

(comments are locked)
10|3000 characters needed characters left

Safari has a bug related to sending focus messages to plugins, which may be causing this. You can test this, does the problem go away if you set Safari to 32-bit mode in the info panel in the Finder? If it does, then it is this known Safari bug (which I have reported to Apple).

more ▼

answered Dec 07 '10 at 12:13 PM

jonas echterhoff gravatar image

jonas echterhoff ♦♦
9.7k 7 23 102

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x953
x810
x336
x6

asked: Dec 07 '10 at 08:43 AM

Seen: 1725 times

Last Updated: Aug 18 '12 at 02:34 AM