SDL++
C++wrapperfortheSDLlibrary.

event/Components.h

Go to the documentation of this file.
00001 
00021 #ifndef SDL_EVENT_COMPONENTS_H
00022 #define SDL_EVENT_COMPONENTS_H
00023 
00024 namespace sdl {
00025 namespace event {
00030     struct Axis {
00038         static int which (const SDL_Event* event) { return event->jaxis.axis; };
00039     };//Axis
00040 
00045     struct Hat {
00053         static int which (const SDL_Event* event) { return event->jhat.hat; };
00054     }; //Hat
00055     
00060     struct JoystickButton {
00068         static int which (const SDL_Event* event) { return event->jbutton.button; };
00069     }; //Button
00070 
00075     struct Key {
00083         static int which (const SDL_Event* event) { return event->key.keysym.sym; };
00084     }; //Key
00085 
00090     struct MouseButton {
00098         static int which (const SDL_Event* event) { return event->button.button; };
00099     }; //Button
00100 
00105     struct Trackball {
00113         static int which (const SDL_Event* event) { return event->jball.ball; };
00114     }; //Trackball
00115 
00120     struct User {
00128         static int which (const SDL_Event* event) { return event->user.code; };
00129     }; //User
00130 }; //event
00131 }; //sdl
00132 
00133 #endif //SDL_EVENT_COMPONENTS_H
00134 
 All Classes Namespaces Files Functions Variables Typedefs