1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#ifdef _WIN32
#include <windows.h>
#include <windowsx.h>
#else
#include <sys/time.h>
#include <time.h>
#endif
#include "SDL/SDL.h"
bool IsAltPressed()
{
SDLMod modifiers;
SDL_PumpEvents();
modifiers=SDL_GetModState();
return ((modifiers & KMOD_ALT) != 0);
} /* IsAltPressed */
bool IsAltPressed2()
{
#ifdef _WIN32
return (GetKeyState (VK_MENU) & 0x8000) ? true : false;
#else
SDL_PumpEvents();
return ( (SDL_GetModState() & KMOD_ALT) != 0);
#endif
}
|