web player arrow keys scroll page

Hello everyone

this is my first posting to the forums since i’m a
new proud user of the indie version. :slight_smile:

I publish to web page and the unity window is located
somewhere about the top of the web page.

I like to use the ARROW keys for FPS navigation.
BUT when i use the up/down arrow keys in the web page i ALSO scroll the browser’s window. :frowning:
( my web page content has to be longer than the screen ).

Question: is it possible to prevent the browser from scrolling the page content with the arrow keys ( js , dhtml , css ,other ) ?

My other alternative is to warn the user about this
quirk and advise them to use the W,A,S,D keys combination for navigation instead…

I understand this is not much of a unity issue, it’s more about the browser but maybe someone has a good solution for me. I did my searching on the forum before posting but if this has already been addressed please point me to the relevant thread!

Thanks in advance
Konstantinos J. Biblis, TD

The page scrolling happens because the web player doesn’t have focus, thus Safari will use the event for scrolling, when the player has focus it will not be used for scrolling the page anymore.

In order for a webplugin to have focus, you have to click on it. Thus it makes a lot of sense to always have some gui button the user has to click before the game starts.

Another approach is to simply have a page which has no scroll bars.

Thank you for your answer …

I think that this “focus” hint you gave me will do the trick …

Is there any way the web player can “understand” if it has focus or not ?

In that case i could auto-pause the webplayer until user returns the focus back to the player …

Im thinking about dhtml/css focus check on a div and passing the message back to web player for pause/run.
( i haven’t touched this part of unity though yet)

Ps. Btw after searching again the forums with the keyword “focus” i found this relevant thread http://forum.unity3d.com/viewtopic.php?t=3244
which addresses this matter among others.

Thanks again,
Konstantinos J. Biblis, TD