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

improper KEYDOWN events #4181

Open
jzfalero opened this issue Mar 26, 2024 · 0 comments
Open

improper KEYDOWN events #4181

jzfalero opened this issue Mar 26, 2024 · 0 comments

Comments

@jzfalero
Copy link

When a keyboard key is pressed 1 time and then held down, it is expected that only 1 single KEYDOWN event will be queued. However, if we switch between full-screen and windowed modes in response to the KEYDOWN event and keep the key pressed, something unexpected happens. Since pygame.display.set_mode() destroys the window and then creates a new one, this new window seems to sense the key press and then improperly places another KEYDOWN event on the queue. As a result of this, the window goes into full-screen mode, in response to the first KEYDOWN event, but then returns to windowed mode, in response to the second KEYDOWN event, which should not exist.

Environment: Linux(Debian), X11, Python 3.9.2, Pygame 2.5.2, SDL 2.28.2

Captura de tela em 2024-03-26 01-58-31

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