On Linux (Mint, with Xfce), it constantly triggers, unless I consciously work on keeping Alt down longest.
On Linux, SDLPoP doesn't have the issue.
On Linux, this fixes this issue that test.c has. It's striking that it needs such a complex solution, given you'd think all coders who use Tab anywhere can run into this. Maybe coders could use a e.g. KMOD_FROMALTTAB, or maybe SDL should ignore Alt+Tab Tab downs (and ups) to begin with. Regardless, thanks.
I did try to solve a similar issue with Alt+F4 as such:
Code: Select all
/* This if() prevents the program from reacting to the
* closure of other windows, such as SDLPoP, with Alt+F4.
*/
if ((!(event.key.keysym.mod & KMOD_LALT)) &&
(!(event.key.keysym.mod & KMOD_RALT)))
{ EXE_F4(); }
I'm guessing a variation of the your fix will work there too; I'll try it.
Maybe most programs react to key up instead of key down.
(If that even fixes the issue. The whole thing confuses me.)