1 /* $Id: event.c,v 1.8 2003-01-15 02:42:41 btb Exp $ */
4 * SDL Event related stuff
18 extern void key_handler(SDL_KeyboardEvent *event);
19 extern void mouse_button_handler(SDL_MouseButtonEvent *mbe);
20 extern void mouse_motion_handler(SDL_MouseMotionEvent *mme);
21 #ifndef USE_LINUX_JOY // stpohle - so we can choose at compile time..
22 extern void joy_button_handler(SDL_JoyButtonEvent *jbe);
23 extern void joy_axis_handler(SDL_JoyAxisEvent *jae);
26 static int initialised=0;
32 while (SDL_PollEvent(&event)) {
36 key_handler((SDL_KeyboardEvent *)&event);
38 case SDL_MOUSEBUTTONDOWN:
39 case SDL_MOUSEBUTTONUP:
40 mouse_button_handler((SDL_MouseButtonEvent *)&event);
43 mouse_motion_handler((SDL_MouseMotionEvent *)&event);
45 #ifndef USE_LINUX_JOY // stpohle - so we can choose at compile time..
46 case SDL_JOYBUTTONDOWN:
48 joy_button_handler((SDL_JoyButtonEvent *)&event);
50 case SDL_JOYAXISMOTION:
51 joy_axis_handler((SDL_JoyAxisEvent *)&event);
53 case SDL_JOYBALLMOTION:
54 case SDL_JOYHATMOTION:
67 // We should now be active and responding to events.