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

Keyup prevents autorepeat on other key in Wayland #6267

Closed
schauveau opened this issue Sep 20, 2022 · 1 comment · Fixed by #6270
Closed

Keyup prevents autorepeat on other key in Wayland #6267

schauveau opened this issue Sep 20, 2022 · 1 comment · Fixed by #6270

Comments

@schauveau
Copy link

When using the wayland backend, the SDL_KEYDOWN produced by the keyboard auto-repeat are not generated anymore after another key is released.

I am on Debian, Sway with SDL 2.24.0

That behavior can be shown with this simple program
sdlkey.cc.txt

Steps to reproduce:

  1. compile and run the program with SDL_VIDEODRIVER=wayland
  2. press the 'a' key to generate multiple KEYDOWN 97 events.
  3. press the 'b' key to generate multiple KEYDOWN 98 events.
  4. release the 'a' key.

A KEYUP 97 event is generated (so far so good) but nothing else even though the 'b' key is still pressed.

When using the X11 driver, some KEYDOWN 98 events are still produced after the KEYUP 97.

I noticed that issue in Cataclysm DDA. See CleverRaven/Cataclysm-DDA#61154

@Kontrabant
Copy link
Contributor

I was able to reproduce this. The issue is that the Wayland backend uses a boolean flag to set/unset the repeat system and it's cleared as soon as any of the pressed keys are released, even if the released key isn't the one being repeated.

The repeated key needs to be tracked and the repeat flag cleared only when that particular key is released. I'll have a patch for it soon.

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 a pull request may close this issue.

2 participants