Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
How do I Request the Keyboard Focus from C3 game?
It seems that my game does not receive the focus when I start the game.
The game is running inside iframe of course.
The event "ON ANY KEY PRESS" only works if I click the game with mouse first.
I don't know if it's possible to request focus from the inside of an iframe. But you should be able to set focus to iframe from the parent page.
Develop games in your browser. Powerful, performant & highly capable.
I think browsers enforce that you must click/touch inside an iframe before it receives keyboard input for security reasons. Otherwise a hidden iframe could act as a keylogger.