Closed ecj2 closed 6 years ago
I believe event.preventDefault()
being called from withing Momo.manageMouseEvents()
is the culprit here. The default for clicking within a frame is to set focus to said frame, but because the default event is being prevented across all mouse events, focus is never set. I think I can fix this by not calling event.preventDefault()
if the event is not related to one of the mouse buttons.
If a game installs the mouse and is played from within an iframe, clicking on the iframe does not set focus to the canvas, thus preventing keyboard inputs from working. However, if the mouse is not installed, clicking on the iframe does set focus to the canvas, and things work as expected.