diff options
Diffstat (limited to 'backends/events/sdl/sdl-events.h')
-rw-r--r-- | backends/events/sdl/sdl-events.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/backends/events/sdl/sdl-events.h b/backends/events/sdl/sdl-events.h index 5fd3cb7ea5..cea944fb1a 100644 --- a/backends/events/sdl/sdl-events.h +++ b/backends/events/sdl/sdl-events.h @@ -80,6 +80,11 @@ protected: /** Joystick */ SDL_Joystick *_joystick; +#if SDL_VERSION_ATLEAST(2, 0, 0) + /** Game controller */ + SDL_GameController *_controller; +#endif + /** Last screen id for checking if it was modified */ int _lastScreenID; @@ -117,9 +122,19 @@ protected: virtual bool handleJoyAxisMotion(SDL_Event &ev, Common::Event &event); virtual bool handleKbdMouse(Common::Event &event); +#if SDL_VERSION_ATLEAST(2, 0, 0) + virtual bool handleControllerButton(const SDL_Event &ev, Common::Event &event, bool buttonUp); + virtual bool handleControllerAxisMotion(const SDL_Event &ev, Common::Event &event); +#endif + //@} /** + * Update the virtual mouse according to a joystick or game controller axis position change + */ + bool handleAxisToMouseMotion(int16 xAxis, int16 yAxis); + + /** * Assigns the mouse coords to the mouse event. Furthermore notify the * graphics manager about the position change. */ |