Greetings.
There is a bug in the SDL port that prevents alt/meta modifiers from being recognized. As the code in question is shared by many variants, I think here is a good place for a bug report. Correct me if I'm wrong.
In the sdl_keypress function (main-sdl.c) we find this innocently looking code:
It looks correct and it would work correctly if only there were built-in bool type in (pre-C99) C. But there is none and in many *bands bool is defined as char (Vanilla uses built-in boolean type when it's available, so it is not affected by this bug -- but only if compiled with something conforming to C99 standard). Values of KMOD_ALT and KMOD_META exceed 0x100. When cast to char they are truncated, so ma and mm are always zero.
This can be fixed either by using int instead of bool for flags:
or by explicit comparison with KMOD_NONE:
IMHO, even better solution would be to get rid of bool type entirely, removing it both from *band code and C standards -- the language just do not need it. But that would be too much work.
There is a bug in the SDL port that prevents alt/meta modifiers from being recognized. As the code in question is shared by many variants, I think here is a good place for a bug report. Correct me if I'm wrong.
In the sdl_keypress function (main-sdl.c) we find this innocently looking code:
Code:
/* Store the value of various modifier keys */ bool mc = (bool)(keysym.mod & (KMOD_CTRL)); bool ms = (bool)(keysym.mod & (KMOD_SHIFT)); bool ma = (bool)(keysym.mod & (KMOD_ALT)); bool mm = (bool)(keysym.mod & (KMOD_META));
This can be fixed either by using int instead of bool for flags:
Code:
... int mc = (keysym.mod & (KMOD_CTRL)); ...
Code:
... bool mc = (bool)((keysym.mod & (KMOD_CTRL) != KMOD_NONE); ...
Comment