🤑 Indie game store🙌 Free games😂 Fun games😨 Horror games
👷 Game development🎨 Assets📚 Comics
🎉 Sales🎁 Bundles

Handle Arrow keys inside iframe

A topic by Wild Spike created Oct 20, 2017 Views: 143 Replies: 2
Viewing posts 1 to 3


Recently I add html5 game with keyboard and mouse support. It works fine as standalone html5 application. But arrow keys doesn't forwarded into game on this site.

Problem - https://wildspike.itch.io/way-of-tanks

Works fine - http://apps.ugolnik.info/wayoftanks/

Is it possible to fix on yours or my side?

Admin (Edited 1 time)

What game engine are you using? Some engines bind to event handlers in a way that isn't friendly with iframes. Here's a discussion about the problem with someone using pixi.js: https://github.com/itchio/itch.io/issues/727#issuecomment-337490481


Thank you for reply. I use my own game engine. Here is workaround:

postRun: (function() {
                window.addEventListener('mousedown', function(evt) {
                    evt.target.style.cursor = 'default';
                }, false);