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

Fixing the Issue of Keys Sticking When the Window Loses Focus #7429

Open
1 task done
Panarins opened this issue Feb 26, 2025 · 0 comments
Open
1 task done

Fixing the Issue of Keys Sticking When the Window Loses Focus #7429

Panarins opened this issue Feb 26, 2025 · 0 comments

Comments

@Panarins
Copy link

Is there an existing issue for this?

Describe the bug

While developing a game, the following situation occurs: if the player holds down a movement key and then clicks the mouse outside the game window (thereby losing focus), after releasing the key and returning to the game window, the character continues to move. Moreover, upon returning to the window, the game does not register new key presses, and the character continues moving until the same key is pressed again.

I believe this is a serious problem for web games. Most portals, such as Poki and Crazy Games, launch games in windowed mode, and I receive a lot of negative feedback because of this bug. Players complain that the character continues running in one direction, and they cannot do anything about it since they don't realize they have to press the same key again after losing focus. As a result, they leave the game and give it a dislike, which significantly impacts player retention. The issue arises on multiple portals, so it’s not tied to any specific platform. On gd.games, all games with similar controls experience this problem.

Steps to reproduce

  1. Launch the game developed using GDevelop.
  2. Hold down a key to move the character (for example, W).
  3. Click the mouse outside the game window to lose focus.
  4. Release the movement key.
  5. Return to the game window — the character continues moving, even though the key has been released.

GDevelop platform

Web

GDevelop version

5.5.224

Platform info

OS (e.g. Windows, Linux, macOS)

OS Version (e.g. Windows 10, macOS 10.15)

Browser(For Web) (e.g. Chrome, Firefox, Safari)

Additional context

Game where you can test the bug: https://poki.com/en/g/cat-pizza

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