X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsdl.h;h=c49894f6836deb17a4ad7f0a883cfbc3da74a3fb;hb=888ee049;hp=627617d245594db15017f4ae75d14e92dac3fdf8;hpb=eb201ff71896cf5291e3ad61ccc663d9cec1b825;p=rocksndiamonds.git diff --git a/src/libgame/sdl.h b/src/libgame/sdl.h index 627617d2..c49894f6 100644 --- a/src/libgame/sdl.h +++ b/src/libgame/sdl.h @@ -65,6 +65,8 @@ typedef SDL_Event PauseResumeEvent; typedef SDL_WindowEvent WindowEvent; typedef SDL_KeyboardEvent KeyEvent; +typedef SDL_EventFilter EventFilter; + // structure definitions @@ -88,6 +90,21 @@ struct MouseCursorInfo byte mask[CURSOR_MAX_WIDTH * CURSOR_MAX_HEIGHT / 8]; }; +struct UserEventInfo +{ + // same as in "struct SDL_UserEvent" + Uint32 type; + Uint32 timestamp; + Uint32 windowID; + Sint32 code; + + // changed to use integer values instead of void pointers + Uint32 value1; + Uint32 value2; +}; + +typedef struct UserEventInfo UserEvent; + // SDL symbol definitions @@ -106,6 +123,7 @@ struct MouseCursorInfo #define EVENT_TEXTINPUT SDL_TEXTINPUT #define EVENT_KEYPRESS SDL_KEYDOWN #define EVENT_KEYRELEASE SDL_KEYUP +#define EVENT_USER SDL_USEREVENT #define EVENT_QUIT SDL_QUIT #define KSYM_UNDEFINED SDLK_UNKNOWN @@ -332,6 +350,15 @@ struct MouseCursorInfo #define KSYM_FKEY_LAST KSYM_F12 #define KSYM_NUM_FKEYS (KSYM_FKEY_LAST - KSYM_FKEY_FIRST + 1) +#define KSYM_PRINTABLE(k) (((k) >= KSYM_space && \ + (k) <= KSYM_z) || \ + (k) == KSYM_Adiaeresis || \ + (k) == KSYM_Odiaeresis || \ + (k) == KSYM_Udiaeresis || \ + (k) == KSYM_adiaeresis || \ + (k) == KSYM_odiaeresis || \ + (k) == KSYM_udiaeresis) + #define KMOD_None KMOD_NONE #define KMOD_Shift_L KMOD_LSHIFT #define KMOD_Shift_R KMOD_RSHIFT @@ -353,8 +380,6 @@ struct MouseCursorInfo KMOD_Meta | \ KMOD_Alt) -#define KMOD_TextInput (KMOD_Shift | KMOD_Alt_R) - // SDL function definitions boolean SDLSetNativeSurface(SDL_Surface **); @@ -405,6 +430,7 @@ void SDLOpenAudio(void); void SDLCloseAudio(void); void SDLWaitEvent(Event *); +void SDLCorrectRawMousePosition(int *, int *); void HandleJoystickEvent(Event *); void SDLInitJoysticks(void);