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

capture Escape key in fullscreen mode #1721

Open
felix9 opened this issue Jan 27, 2025 · 0 comments
Open

capture Escape key in fullscreen mode #1721

felix9 opened this issue Jan 27, 2025 · 0 comments

Comments

@felix9
Copy link

felix9 commented Jan 27, 2025

some games/emulators use the Escape key, which is fine, but when running in fullscreen mode on a chrome browser, Escape exits fullscreen mode. pressing escape again will send Escape to the game, and then you can enter fullscreen mode again, but this is awkward and inconvenient.

chrome allows fullscreen apps to capture the Escape key (the user then exits fullscreen by holding down Escape).

details here https://developer.chrome.com/blog/better-full-screen-mode

note, this has to be done by the top-level page. an iframe does not get fullscreenChange events, and it cannot invoke keyboard.lock

this would be a useful option for games embedded on itch.io. (it might be reasonable to do this unconditionally? but an option seems safer.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant