fable-compiler / repl-legacy

http://fable.io/repl
MIT License
14 stars 10 forks source link

Preview window doesn't recognize keyboard input #11

Closed alfonsogarciacaro closed 6 years ago

alfonsogarciacaro commented 6 years ago

Maybe this helps https://stackoverflow.com/questions/1199075/keydown-event-on-a-iframe

MangelMaxime commented 6 years ago

@alfonsogarciacaro Under linux + firefox I have the games samples working (mario + ozmo).

But of course you need to click, in the iframe/canvas to give focus to the iframe window so it can capture the keyboard events.

And yes, we could probably allow the iframe to listen to keyevents from the parent window but not sure of the drawbacks here.

alfonsogarciacaro commented 6 years ago

Ah, ok. So you need to click the iframe, didn't thought of that 😅 Maybe we can add a message to warn users as silly as me :wink:

alfonsogarciacaro commented 6 years ago

Anyway, that should be enough for now. Thanks a lot for checking, I'll close the issue :+1: