Skip to content

[rcore] [web] Pressing F1 opens a help tab in certain chromium based browsers. #4951

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

Open
Moros1138 opened this issue May 21, 2025 · 0 comments

Comments

@Moros1138
Copy link

Moros1138 commented May 21, 2025

Issue description

In Microsoft Edge and Google Chrome I have noticed pressing F1 opens a help tab.

Repoduce in the affected browsers by following these steps:

  1. Visit: https://www.raylib.com/examples/shapes/loader.html?name=shapes_top_down_lights
  2. click anywhere in the running example to ensure it has focus
  3. Press 'F1' key
  4. See the problem.

I assume, given the pattern involves Chromium based browsers that this is true of other similarly based browsers. Firefox was unaffected.

Environment

Windows 11
Microsoft Edge Version 136.0.3240.76 (Official build) (64-bit)
Google Chrome Version 136.0.7103.114 (Official Build) (64-bit)

Possible Solution

I fixed this locally in my own build adding the following to my shell:

        document.addEventListener('keydown', function(event)
        {
            if (event.key == 'F1' || event.keyCode == 112)
                event.preventDefault();
        });

this could easily be integrated into the web platform code like so:

EM_ASM({
        document.addEventListener('keydown', function(event)
        {
            if (event.key == 'F1' || event.keyCode == 112)
                event.preventDefault();
        });
});

Probably somewhere in InitPlatform.

@Moros1138 Moros1138 changed the title [module] Short description of the issue/bug/feature [rcore] [web] Pressing F1 opens a help tab in certain chromium based browsers. May 21, 2025
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

1 participant