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

Some keys are triggering twice since SDL 2.28.2 and higher #743

Closed
barbeque-squared opened this issue Sep 3, 2023 · 2 comments · Fixed by #782
Closed

Some keys are triggering twice since SDL 2.28.2 and higher #743

barbeque-squared opened this issue Sep 3, 2023 · 2 comments · Fixed by #782

Comments

@barbeque-squared
Copy link
Member

This is an issue on at least Linux. It's confirmed on Archlinux. Unsure about other distro's or OSes.

How to reproduce:

  • Install SDL 2.28.2 or higher
  • Run USDX
  • Sing -> ignore player setup -> E to edit any song
  • Press + or - on the Numpad

Expected result:
The Tone field is edited by +1 or -1
screenshot0010

Actual result:
The Tone field is edited by +2 or -2

Similar bugs have been reported outside of github in the form of "pause not working" (= it's probably being triggered twice, thus pausing+unpausing)

Downgrading to version 2.28.1 of Archlinux sdl2 package fixes the issue.

From the SDL release notes I can't tell if this is a regression in SDL or USDX using a now-deprecated way of handling keys, but considering it's a bugfix SDL version introducing this behaviour for now I'm leaning towards a regression. I'll open a ticket in the SDL repo and link it here

@barbeque-squared
Copy link
Member Author

ticket at SDL: libsdl-org/SDL#8193

@barbeque-squared
Copy link
Member Author

ticket at SDL has been closed because it's impossible to reproduce when building directly from the repo (or actually the other way around: it always breaks, even on very old versions). As mentioned there, USDX' SDL_KEYDOWN, SDL_TEXTINPUT handler isn't particularly readable either and frankly I'm surprised it has ever worked at all. SDL_StartTextInput being done right before the main loop (and that being the only time it's used) is also strange to me: it doesn't make sense for that to be active all the time?

It can probably be split into two separate handlers and then each screen can decide what to with it. Also enable/disable the actual textinput stuff instead of having it active all the time.

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.

1 participant