This event is only used for the "quit" event in SDL 2.0 now.
{
switch (event->type)
{
- case EVENT_CLIENTMESSAGE:
- HandleClientMessageEvent((ClientMessageEvent *) event);
- break;
-
case SDL_CONTROLLERBUTTONDOWN:
case SDL_CONTROLLERBUTTONUP:
// for any game controller button event, disable overlay buttons
HandleDropEvent(event);
break;
+ case EVENT_QUIT:
+ CloseAllAndExit(0);
+ break;
+
default:
break;
}
HandleKey(key, key_status);
}
-void HandleClientMessageEvent(ClientMessageEvent *event)
-{
- if (CheckCloseWindowEvent(event))
- CloseAllAndExit(0);
-}
-
static int HandleDropFileEvent(char *filename)
{
Error(ERR_DEBUG, "DROP FILE EVENT: '%s'", filename);
void HandlePauseResumeEvent(PauseResumeEvent *);
boolean HandleKeysDebug(Key, int);
void HandleKeyEvent(KeyEvent *);
-void HandleClientMessageEvent(ClientMessageEvent *);
void HandleDropEvent(Event *);
void HandleToonAnimations(void);
typedef SDL_Event PauseResumeEvent;
typedef SDL_WindowEvent WindowEvent;
typedef SDL_KeyboardEvent KeyEvent;
-typedef SDL_Event ClientMessageEvent;
// structure definitions
#define EVENT_TEXTINPUT SDL_TEXTINPUT
#define EVENT_KEYPRESS SDL_KEYDOWN
#define EVENT_KEYRELEASE SDL_KEYUP
-#define EVENT_CLIENTMESSAGE SDL_QUIT
+#define EVENT_QUIT SDL_QUIT
#define KSYM_UNDEFINED SDLK_UNKNOWN
#endif
}
-boolean CheckCloseWindowEvent(ClientMessageEvent *event)
-{
- if (event->type != EVENT_CLIENTMESSAGE)
- return FALSE;
-
- return TRUE; // the only possible message here is SDL_QUIT
-}
-
// ============================================================================
// joystick functions
KeyMod GetKeyModStateFromEvents(void);
void StartTextInput(int, int, int, int);
void StopTextInput(void);
-boolean CheckCloseWindowEvent(ClientMessageEvent *);
void InitJoysticks(void);
boolean ReadJoystick(int, int *, int *, boolean *, boolean *);