Open mikrosk opened 2 months ago
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 #if defined(SDL12_COMPAT_HEADERS) && SDL12_COMPAT_VERSION < XXX
, that would be ideal.
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: https://github.com/atari800/atari800/issues/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
.