IE10, Keyboard keys don't work within an iFrame?

Recommended Posts

Hi all, random problem here, wondering if anyone has had it - we're trying to develop a facebook game which consists of a Phaser app running in an iFrame. It all works great, but for some reason, the keyboard keys never register in IE10. 


We've tried ensuring the iFrame has focus, tried setting game.stage.disableVisibilityChange to false and to true, but cannot for the life of us figure out why the Phaser app can't control the keyboard from within an iFrame.


Does anyone know if there's a way, maybe from the parent document, to allow Phaser to capture the keys?


Thanks in advance,



Share this post

Link to post
Share on other sites

Had the same issue this morning - this resolved it for me in IE11. 


<script type="text/javascript">    function setFocus() {        var iframe = $("#game")[0];        iframe.contentWindow.focus();    }    $(document).ready(function(){      setTimeout(setFocus, 100);    });</script>

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.