The follow code causes the program to exit in Linux when is pressed.
The same code in Windows ignores it and does not exit. Anyone have a solution?
TIA,
Jeff---------------
SDL_EnableUNICODE(TRUE);
switch (event.type)
{
case SDL_QUIT:
appQuit = TRUE;
break;
case SDL_KEYDOWN:
sdlkey = event.key.keysym.unicode;
if (event.key.keysym.sym == SDLK_x) // allow alt-x to exit
{
if (event.key.keysym.mod == KMOD_LALT || event.key.keysym.mod ==
KMOD_RALT)
appQuit = TRUE;
}
if (!appQuit && sdlkey) // not alt-x, process key input
dispatchKeyDown(&event);
break;
In Tux Paint, we seem to have this:
SDLMod alt = event.key.keysym.mod & KMOD_ALT;
And then test that variable. shrug
Good luck!
-bill!On Sat, Jun 18, 2005 at 03:34:58PM -0700, Jeff wrote:
The follow code causes the program to exit in Linux when is pressed.
The same code in Windows ignores it and does not exit. Anyone have a solution?
Quoth Jeff <j_post at pacbell.net>, on 2005-06-18 15:34:58 -0700:
if (event.key.keysym.mod == KMOD_LALT || event.key.keysym.mod ==
KMOD_RALT)
Note that KMOD_NUM, KMOD_CAPS, and KMOD_MODE exist as well, so if you
have Num Lock, Caps Lock, (or Scroll Lock?) on, this will fail.
—> Drake Wilson
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20050618/eca69e1a/attachment.pgp
The follow code causes the program to exit in Linux when is
pressed. The same code in Windows ignores it and does not exit. Anyone
have a solution?
In Tux Paint, we seem to have this:
SDLMod alt = event.key.keysym.mod & KMOD_ALT;
Thanks Bill!
It now works in both Linux and Windows.
JeffOn Saturday 18 June 2005 04:07 pm, Bill Kendrick wrote: