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
love.keyboard.isDown('ralt')
always returns false
#1875
Comments
From the forums, it seems like you're probably using a very old version of SDL? have you tried updating? If you use the love AppImage instead of relying on whatever dependency versions that old Ubuntu version provides in its package manager, it will use a more recent SDL version. The equivalent love code to your C test program would be SDL_Scancode scancode = SDL_GetScancodeFromKey(SDLK_RALT);
const Uint8 *keyboardstate = SDL_GetKeyboardState(NULL);
if (keyboardstate[scancode])
/* etc */; So I'm guessing |
It seems you are correct once again. However, this time I spent a bit of time bisecting the SDL repo to figure out exactly which commit had fixed this problem. Turns out, the commit is libsdl-org/SDL@99f2a50, which is in the 2.25.1 pre-release, and it was submitted on the 13th of October 2022, which I would say is fairly recent. Ubuntu 22.10 is still at 2.24.0 which wouldn't have the fix anyway, so yeah I guess the AppImage is truly the only fix possible. Thanks for looking into it. |
Thanks for investigating! The love 11.4 appimage was created almost a year ago, so it doesn't have the change from that SDL commit. |
Oh wow.. that is very strange. Do you know by any chance the commit it is based on so I can test it? |
The AppImage script commit is love2d/love-appimage-source@30aaffc, so SDL 2.0.18. |
Honestly I don't think there's LOVE can do about it other than updating SDL. Since LOVE relies heavily on SDL for input, if SDL itself is broken in its input handling then there's nothing LOVE can do. |
Ah yes, I'm not really saying otherwise. I still think it's useful to know that the problem exists, for example when choosing the SDL version to regenerate the AppImage and so on. Also in case someone else finds this problem, at least it is already tracked. |
In the LOVE appimage build script, choosing the SDL version can be as simple as We always update to latest version of the libraries before releasing new LOVE version when possible. |
I reported this problem on the forums, and other people have confirmed it.
It seems that
love.keyboard.isDown('ralt')
always returnsfalse
, no matter what the state of the key is. Note that if they key is pressed or released, the appropriate events are correctly registered (so thatlove.keypressed(key)
andlove.keyreleased(key)
are correclty called with parameter'ralt'
).My system is Lubuntu 20.04, using LOVE 11.4.
The text was updated successfully, but these errors were encountered: