Skip to content

sdl: ignore synthetic keyup events during key repeat#2103

Open
awsms wants to merge 1 commit intoValveSoftware:masterfrom
awsms:fix/sdl-spams-when-held
Open

sdl: ignore synthetic keyup events during key repeat#2103
awsms wants to merge 1 commit intoValveSoftware:masterfrom
awsms:fix/sdl-spams-when-held

Conversation

@awsms
Copy link

@awsms awsms commented Mar 6, 2026

On the SDL backend, holding a key can generate KEYUP events even while the key is still physically held.
Gamescope already ignores repeated KEYDOWN events, but these KEYUPs were still forwarded to wlserver, causing spurious release notifications.

Filter SDL_KEYUP by checking SDL_GetKeyboardState(): if SDL still reports the scancode as pressed, treat the KEYUP as synthetic repeat noise and drop it.

edit: fixes #1183 (comment)

On the SDL backend, holding a key can generate KEYUP events even
while the key is still physically held.
Gamescope already ignores repeated KEYDOWN events, but these KEYUPs
were still forwarded to wlserver, causing spurious release notifications.

Filter SDL_KEYUP by checking SDL_GetKeyboardState():
if SDL still reports the scancode as pressed, treat the KEYUP
as synthetic repeat noise and drop it.
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

Successfully merging this pull request may close these issues.

Holding down a key causes it to spam click instead of remaining held down

1 participant