Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto focus on wasm Ebiten game? #59

Closed
jsantore opened this issue Jul 20, 2021 · 4 comments
Closed

auto focus on wasm Ebiten game? #59

jsantore opened this issue Jul 20, 2021 · 4 comments

Comments

@jsantore
Copy link

https://ebiten.org/documents/webassembly.html

Having followed the steps in the page above to embed my ebiten game into a web page with wasm, I find that the games does not have focus until clicked on. This behavior occurs on both firefox and chromium. Perhaps you could add another step in the directions to make game the focus upon load?

@hajimehoshi
Copy link
Member

hajimehoshi commented Jul 21, 2021

Hm, this sounds like a web programming that might not be related to Ebiten. I'm not sure. Let me think.

Thank you for the suggestion!

@hajimehoshi
Copy link
Member

By default, the game should run even when the game is unfocused (as of v2). Have you tried v2?

@jsantore
Copy link
Author

The game runs automatically, it just doesn't take keyboard input without gaining focus via the mouse. I'm sure it is a web programming issue, I was just wonder if the tutorial which mentions how to embed the game in a web page via webassemby might also mention how to automatically give it focus. I'll try a few things.

thanks

@hajimehoshi
Copy link
Member

Ah yes, the first inputting is a general web programming issue, and I'm sure this is not an Ebiten issue. The first focused element should be determined by the browser or the web author, and personally I don't think this is a good behavior to focus an iframe automatically just after loading a page.

@hajimehoshi hajimehoshi closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants