Hi when I put my game inside an iframe tag on my website the game doesn’t get the keyboard focus when you click inside the game window. The workaround for the is that he has to click buttons Pause and Resume, then you can use the keyboard but the cursor UP and DOWN still keep sending keystrokes to the browser and the whole page do scroll UP and DOWN.
I’ve spoken with our HTML5 Developer and it’s suggested that you try to replace the HTML5 template with a simpler one that we provide. It’s suggested to use one that only contains the canvas element and very little else therefore, the inputs will not be blocked.
However, if you happen to notice that you’re still having this issue, please feel free to reply back with additional details and we will assist you further.
Both has problems of keyboard focus when inside an iframe.
I want to publish the game inside an iframe on my website so I can display more info, links and advertisements; Also if I want to publish my game in any HTML5 market they will need to put the app inside an iframe or something similar.
So the keyboard input works correctly as long as you press resume. You may want to go into your iFrame code and take out the buttons, so that the keyboard input isn’t overridden. Have you tried this previously?
Hi,
Except the cursor UP/DOWN everything else work fine once I press resume. The buttons are from the generated code of UE4, my iframe has nothing more than a link to the hosted game in other folder.
If you mean editing the html generated by UE4 at least a need a hint where to change or delete, since I’m not very experienced at web programming, I just what i need and copy-paste examples from w3schools!
Basically, you would need to is locate the .HTML5 file, right-click and select ‘edit’. Once you’re in the HTML5 editing document, you’ll see the following code close to the end of the sheet:
Sincerely, fixing this issue is not urgent for me. If in the new update (4.9) it will come with a new HTML5 template without these problem of keyboard focus, I can wait for that
kind regards,
piX (Denys)
Could you provide me a zipped package of the whole packaged project for HTML5 through a private message on the forums? I’d really like to look at this error more closely for you.
I’ve gotten back some information and we believe we’ve located a possible bug in the SDL2 event handler. I have submitted some additional findings to our HTML5 developers and hope to hear back soon.
I did find out that the reason deleting the code from HTML5 did not work correctly is due to the JavaScript involved. An alternative method is that instead of removing the buttons altogether, I’ve given them a “display: none;” CSS style, which causes the buttons to exist on the page, but they don’t get rendered or laid out to take any space on the page, so they are effectively invisible and removed.
If you have any further questions, please let me know as I’ll be more than happy to assist you further.