Some time long ago there was a change in X which led to SDL "automagically" marking keys as "released" even as they were held down continuously. With attached 'SDLdemo.cpp' you can observe this behaviour; I concentrated on the SHIFT keys because that especially annoyed me: I still like to play certain old DOS pinball games, and I didn't like it when I raised a flipper with a SHIFT key early for a drop catch, only to see the flipper fall down before the ball even hit it. I solved this with the attached 'FocusInOut.patch', which should remedy unintended release events for all keys. Reproducible: Always
Created attachment 685566 [details] Test program to illustrate the problem / effect of patch
Created attachment 685569 [details, diff] proposed patch
Hm, my shift keys are being held normally with that demo for as long as I hold them. Or do you mean you want to stop key release when actually focusing out of the window? e.g. even if raising another window If not, maybe there is something interfering? Like your window manager behavior, or original non-xfixes unclutter (just something that comes to mind, not that I have many ideas).
(In reply to Ionen Wolkens from comment #3) Sorry it took me so long to respond! I can't reproduce the behaviour either, nowadays. When I made that patch, the shift keys got released after a short time, without a focus change to another window. Sorry for the noise, please close the bug.
I see, no problems :)