Jump to content

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


ChubbRck
 Share

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,

 

Nick

Link to comment
Share on other sites

  • 3 months later...

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>
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...