The iframe will need to have focus for the contents of the game to receive keyboard events. The user will have to click something in the frame to move their focus inside of it.