-
Notifications
You must be signed in to change notification settings - Fork 42
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
SDLK_CAPSLOCK works differently than in SDL 1.2 #331
Comments
This needs to be fixed in sdl12-compat to work like classic 1.2, even if it seems like the less correct behavior. I would recommend reverting the patch in your code and we'll correct sdl12-compat. |
Does sdl12-compat provide some kind of versioning? Because if I revert our patch, it may take a while before the new sdl12-compat makes it into Debian, Ubuntu etc. So if I could put there something like |
While this fixed issue #177, it also introduced regression on targets with native SDL 1.2. This assumes libsdl-org/sdl12-compat#331 will be fixed in 1.2.70; then the #if can be removed because the code shall be again compatible with SDL 1.2 (despite its less than ideal behavior).
include/SDL/SDL_version.h:#define SDL_PATCHLEVEL 68 Everything above 50 is the compat variant by definition. |
Our project still uses SDL1.2 API (not only due to lack of manpower to do the transition to SDL2 but also because some other backends lack SDL2 entirely). In december 2023 we discovered a discrepancy in CAPSLOCK behaviour between SDL 1.2 and SDL12-compat: atari800/atari800#177.
I didn't make too much of it, I merged the patch however I hadn't realised that this will break any platform still using native SDL 1.2 library and indeed, today I have discovered just that.
In short, the original SDL doesn't send "key up" for CAPSLOCK: https://github.com/libsdl-org/SDL-1.2/blob/be74a7a89a5b004a03a04e3c4279d9068f88cfcd/src/events/SDL_keyboard.c#L496-L497 and simulates "key up" when pressed for the second time: https://github.com/libsdl-org/SDL-1.2/blob/be74a7a89a5b004a03a04e3c4279d9068f88cfcd/src/events/SDL_keyboard.c#L449-L450.
Presumably SDL2 doesn't do this kind of distinction and therefore neither does SDL12-compat.
Personally I find SDL12-compat/SDL2's behaviour more logical but I can't decide which side should be fixed now:
In the meantime perhaps I'll try to partially revert our patch and put it between
#ifdef SDL12_COMPAT_HEADERS
.The text was updated successfully, but these errors were encountered: