Forum

Controls in an iframe

13 October 2015 22:26
I am loading a scene on a webpage through an iframe. I have a character and have defined keyboard sensors, but i cannot capture the key presses through the iframe? My scene is similar to the "making a game example" you have? is there anyway yo get this to work?
14 October 2015 12:25
Hello,

This is a common problem for iframe applications. You need to set focus to the iframe-element if you want to have keyboard controls inside it. This can be solved in the manner it is described on the stackoverflow. Here is a link.

So you can add something like this to your iframe element:
<iframe src="your.html" width="800px" height="600px" onload="this.contentWindow.focus()"></iframe>
16 October 2015 18:26
Sorry, i looked a little more and came across the answer in the forums
 
Please register or log in to leave a reply.