SDL++
C++wrapperfortheSDLlibrary.

event/JoystickEvents.h

Go to the documentation of this file.
00001 
00021 #ifndef SDL_EVENT_JOYSTICKEVENTS_H
00022 #define SDL_EVENT_JOYSTICKEVENTS_H
00023 
00024 #include <SDL.h>
00025 
00026 #include "sdlpp/event/Components.h"
00027 #include "sdlpp/event/MultiComparator.h"
00028 #include "sdlpp/event/Event.h"
00029 
00030 namespace sdl {
00031 namespace event {
00032     using namespace misc;
00033 
00038     struct JoystickAxisBase : public EventBase {
00044         explicit JoystickAxisBase (const SDL_Event* event) : EventBase (event) {};
00045 
00051         const SDL_JoyAxisEvent& get () const { return event_->jaxis; };
00052     
00058         const SDL_JoyAxisEvent& get () { return event_->jaxis; };
00059     }; //JoystickAxisBase
00060 
00067     template<int... Axes>
00068     struct JoystickAxisMotion : public Event<MultiComparator<Axis, SDL_JOYAXISMOTION, Axes...>, JoystickAxisBase> {
00074         explicit JoystickAxisMotion (const SDL_Event* event) : Event<MultiComparator<Axis, SDL_JOYAXISMOTION, Axes...>, JoystickAxisBase> (event) {};
00075     }; //JoystickAxisMotion
00076 
00081     struct JoystickTrackballBase : public EventBase {
00087         explicit JoystickTrackballBase (const SDL_Event* event) : EventBase (event) {};
00088         
00094         const SDL_JoyBallEvent& get () const { return event_->jball; };
00095 
00101         const SDL_JoyBallEvent& get () { return event_->jball; };
00102     }; //JoystickTrackballBase
00103 
00110     template<int... Balls>
00111     struct JoystickTrackballMotion : public Event<MultiComparator<Trackball, SDL_JOYBALLMOTION, Balls...>, JoystickTrackballBase> {
00117         explicit JoystickTrackballMotion (const SDL_Event* event) : Event<MultiComparator<Trackball, SDL_JOYBALLMOTION, Balls...>, JoystickTrackballBase> (event) {};
00118     }; //JoystickTrackballMotion
00119 
00124     struct JoystickHatBase : public EventBase {
00130         explicit JoystickHatBase (const SDL_Event* event) : EventBase (event) {};
00131 
00137         const SDL_JoyHatEvent& get () const { return event_->jhat; };
00138 
00144         const SDL_JoyHatEvent& get () { return event_->jhat; };
00145     }; //JoystickHatBase
00146 
00153     template<int... Hats>
00154     struct JoystickHatMotion : public Event<MultiComparator<Hat, SDL_JOYHATMOTION, Hats...>, JoystickHatBase> {
00160         explicit JoystickHatMotion (const SDL_Event* event) : Event<MultiComparator<Hat, SDL_JOYHATMOTION, Hats...>, JoystickHatBase> (event) {};
00161     }; //JoystickHatMotion
00162 
00167     struct JoystickButtonBase : public EventBase {
00173         JoystickButtonBase (const SDL_Event* event) : EventBase (event) {};
00174 
00180         const SDL_JoyButtonEvent& get () const { return event_->jbutton; };
00181 
00187         const SDL_JoyButtonEvent& get () { return event_->jbutton; };
00188     }; //JoystickButtonBase
00189 
00196     template<int... Buttons>
00197     struct JoystickButtonPress : public Event<MultiComparator<JoystickButton, SDL_JOYBUTTONDOWN, Buttons...>, JoystickButtonBase> {
00203         explicit JoystickButtonPress (const SDL_Event* event = 0) : Event<MultiComparator<JoystickButton, SDL_JOYBUTTONDOWN, Buttons...>, JoystickButtonBase> (event) {};
00204     }; //JoystickButtonPress
00205 
00212     template<int... Buttons>
00213     struct JoystickButtonRelease : public Event<MultiComparator<JoystickButton, SDL_JOYBUTTONUP, Buttons...>, JoystickButtonBase> {
00219         explicit JoystickButtonRelease (const SDL_Event* event = 0) : Event<MultiComparator<JoystickButton, SDL_JOYBUTTONUP, Buttons...>, JoystickButtonBase> (event) {};
00220     }; //JoystickButtonRelease
00221 }; //event
00222 }; //sdl
00223 
00224 #endif //SDL_EVENT_JOYSTICKEVENTS_H
00225 
 All Classes Namespaces Files Functions Variables Typedefs