00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 #ifndef SDLMM_EVENT_H
00022 #define SDLMM_EVENT_H
00023 #include <cstring>
00024 
00025 namespace SDLmm {
00027 
00032   class Event {
00033   public:
00035 
00041     SDL_Event me;
00042 
00044 
00052     bool Poll(bool fetch = true);
00053     
00055 
00064     bool Wait(bool fetch = true);
00065 
00067 
00077     bool Push();
00078 
00080 
00081 
00082 
00094     static void PumpEvents();
00095 
00098 
00126     static void SetEventFilter(SDL_EventFilter filter);
00127 
00129 
00141     static SDL_EventFilter  GetEventFilter();
00142 
00144 
00166     static Uint8 EventState(Uint8 type, int state);
00167 
00169 
00178     static void HandleEvents(EventHandler &handler);
00179     
00181 
00183 
00184     
00186 
00198     static Uint8 *GetKeyState(int &numkeys);
00199 
00201 
00214     static Uint8 *GetKeyState();
00215 
00217 
00239     static SDLMod GetModState();
00240 
00242 
00252     static void SetModState(SDLMod modstate);
00253 
00255 
00259     static char *GetKeyName(SDLKey key);
00260 
00262 
00277     static bool EnableUNICODE(bool enable=true) { return SDL_EnableUNICODE(enable) != 0; }
00278 
00280 
00285     static bool DisableUNICODE() { return SDL_EnableUNICODE(0) != 0; }
00286 
00288 
00294     static bool QueryUNICODE() { return SDL_EnableUNICODE(-1) != 0; }
00295 
00297 
00312     static bool EnableKeyRepeat(int delay = SDL_DEFAULT_REPEAT_DELAY,
00313                                 int interval = SDL_DEFAULT_REPEAT_DELAY);
00315 
00317 
00318 
00319 
00329     static Uint8 GetMouseState(int *x = 0, int *y = 0);
00330 
00332 
00343     static Uint8 GetRelativeMouseState(int *x, int *y);    
00345 
00347 
00348 
00350 
00363     static Uint8 GetAppState();
00364 
00366     
00367 
00368 
00369 
00370 
00371 
00372 
00373 
00374 
00375 
00376 
00377 
00378     
00379     static int JoystickEventState(int state);
00380     
00382   };
00383 }
00384 
00385 #endif // SDLMM_EVENT_H
00386