HandleKeyEvent((KeyEvent *) &event);
break;
+ case EVENT_USER:
+ HandleUserEvent((UserEvent *) &event);
+ break;
+
default:
HandleOtherEvents(&event);
break;
SDL_free(event->drop.file);
}
+void HandleUserEvent(UserEvent *event)
+{
+ switch (event->code)
+ {
+ default:
+ break;
+ }
+}
+
void HandleButton(int mx, int my, int button, int button_nr)
{
static int old_mx = 0, old_my = 0;
boolean HandleKeysDebug(Key, int);
void HandleKeyEvent(KeyEvent *);
void HandleDropEvent(Event *);
+void HandleUserEvent(UserEvent *);
void HandleToonAnimations(void);
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
#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
#endif
}
+void PushUserEvent(int code, int value1, int value2)
+{
+ UserEvent event;
+
+ SDL_memset(&event, 0, sizeof(event));
+
+ event.type = EVENT_USER;
+ event.code = code;
+ event.value1 = value1;
+ event.value2 = value2;
+
+ SDL_PushEvent((SDL_Event *)&event);
+}
+
// ============================================================================
// joystick functions
KeyMod GetKeyModStateFromEvents(void);
void StartTextInput(int, int, int, int);
void StopTextInput(void);
+void PushUserEvent(int, int, int);
void InitJoysticks(void);
boolean ReadJoystick(int, int *, int *, boolean *, boolean *);