1 /* $Id: event.c,v 1.11 2003-06-02 05:56:37 btb Exp $ */
4 * SDL Event related stuff
18 #include "CON_console.h"
21 extern void key_handler(SDL_KeyboardEvent *event);
22 extern void mouse_button_handler(SDL_MouseButtonEvent *mbe);
23 extern void mouse_motion_handler(SDL_MouseMotionEvent *mme);
24 #ifndef USE_LINUX_JOY // stpohle - so we can choose at compile time..
25 extern void joy_button_handler(SDL_JoyButtonEvent *jbe);
26 extern void joy_hat_handler(SDL_JoyHatEvent *jhe);
27 extern void joy_axis_handler(SDL_JoyAxisEvent *jae);
30 static int initialised=0;
36 while (SDL_PollEvent(&event)) {
38 if(!CON_Events(&event))
44 key_handler((SDL_KeyboardEvent *)&event);
46 case SDL_MOUSEBUTTONDOWN:
47 case SDL_MOUSEBUTTONUP:
48 mouse_button_handler((SDL_MouseButtonEvent *)&event);
51 mouse_motion_handler((SDL_MouseMotionEvent *)&event);
53 #ifndef USE_LINUX_JOY // stpohle - so we can choose at compile time..
54 case SDL_JOYBUTTONDOWN:
56 joy_button_handler((SDL_JoyButtonEvent *)&event);
58 case SDL_JOYAXISMOTION:
59 joy_axis_handler((SDL_JoyAxisEvent *)&event);
61 case SDL_JOYHATMOTION:
62 joy_hat_handler((SDL_JoyHatEvent *)&event);
64 case SDL_JOYBALLMOTION:
77 // We should now be active and responding to events.