#include <sdl-events.h>
Public Member Functions | |
void | setGraphicsManager (SdlGraphicsManager *gMan) |
virtual bool | pollEvent (Common::Event &event) |
void | fakeWarpMouse (const int x, const int y) |
bool | isJoystickConnected () const |
void | setEngineRunning (bool value) |
Public Member Functions inherited from Common::EventSource | |
virtual bool | allowMapping () const |
Protected Member Functions | |
void | loadGameControllerMappingFile () |
void | openJoystick (int joystickIndex) |
void | closeJoystick () |
virtual void | preprocessEvents (SDL_Event *event) |
virtual bool | dispatchSDLEvent (SDL_Event &ev, Common::Event &event) |
virtual bool | processMouseEvent (Common::Event &event, int x, int y, int relx=0, int rely=0) |
virtual bool | remapKey (SDL_Event &ev, Common::Event &event) |
virtual int | mapKey (SDL_Keycode key, SDL_Keymod mod, Uint16 unicode) |
virtual void | SDLModToOSystemKeyFlags (SDL_Keymod mod, Common::Event &event) |
Common::KeyCode | SDLToOSystemKeycode (const SDL_Keycode key) |
bool | handleResizeEvent (Common::Event &event, int w, int h) |
uint32 | obtainUnicode (const SDL_Keysym keySym) |
SDL_Keycode | obtainKeycode (const SDL_Keysym keySym) |
Event Handlers | |
Handlers for specific SDL events, called by SdlEventSource::dispatchSDLEvent(). This way, if a managers inherits fromt this SDL events manager, it can change the behavior of only a single event, without having to override all of SdlEventSource::dispatchSDLEvent(). | |
virtual bool | handleKeyDown (SDL_Event &ev, Common::Event &event) |
virtual bool | handleKeyUp (SDL_Event &ev, Common::Event &event) |
virtual bool | handleMouseMotion (SDL_Event &ev, Common::Event &event) |
virtual bool | handleMouseButtonDown (SDL_Event &ev, Common::Event &event) |
virtual bool | handleMouseButtonUp (SDL_Event &ev, Common::Event &event) |
virtual bool | handleSysWMEvent (SDL_Event &ev, Common::Event &event) |
virtual int | mapSDLJoystickButtonToOSystem (Uint8 sdlButton) |
virtual bool | handleJoyButtonDown (SDL_Event &ev, Common::Event &event) |
virtual bool | handleJoyButtonUp (SDL_Event &ev, Common::Event &event) |
virtual bool | handleJoyAxisMotion (SDL_Event &ev, Common::Event &event) |
virtual bool | handleJoyHatMotion (SDL_Event &ev, Common::Event &event) |
Protected Attributes | |
bool | _scrollLock |
bool | _engineRunning |
int | _mouseX |
int | _mouseY |
SDL_Joystick * | _joystick |
int | _lastScreenID |
SdlGraphicsManager * | _graphicsManager |
bool | _queuedFakeMouseMove |
Common::Event | _fakeMouseMove |
uint8 | _lastHatPosition |
The SDL event source.
|
virtual |
void SdlEventSource::fakeWarpMouse | ( | const int | x, |
const int | y | ||
) |
Emulates a mouse movement that would normally be caused by a mouse warp of the system mouse.
bool SdlEventSource::isJoystickConnected | ( | ) | const |
Returns whether a joystick is currently connected
void SdlEventSource::setEngineRunning | ( | bool | value | ) |
Sets whether a game is currently running
|
protected |
Search for a game controller db file and load it.
|
protected |
Open the SDL joystick with the specified index
After this function completes successfully, SDL sends events for the device.
If the joystick is also a SDL game controller, open it as a controller so an extended button mapping can be used.
|
protected |
Close the currently open joystick if any
|
inlineprotectedvirtual |
Pre process an event before it is dispatched.
Reimplemented in PSP2EventSource, and PS3SdlEventSource.
|
protectedvirtual |
Dispatchs SDL events for each handler.
|
protectedvirtual |
Assigns the mouse coords to the mouse event. Furthermore notify the graphics manager about the position change. The parameters relx and rely for relative mouse movement
|
protectedvirtual |
Remaps key events. This allows platforms to configure their custom keys.
Reimplemented in OPEventSource, and SamsungTVSdlEventSource.
|
protectedvirtual |
Maps the ASCII value of key
|
protectedvirtual |
Configures the key modifiers flags status
|
protected |
Translates SDL key codes to OSystem key codes
|
protected |
Notify graphics manager of a resize request.
|
protected |
Extracts unicode information for the specific key sym. May only be used for key down events.
|
protected |
Extracts the keycode for the specified key sym.
|
protected |
Scroll lock state - since SDL doesn't track it
|
protected |
Joystick
|
protected |
Last screen id for checking if it was modified
|
protected |
The associated graphics manager.
|
protected |
Whether _fakeMouseMove contains an event we need to send.
|
protected |
A fake mouse motion event sent when the graphics manager is told to warp the mouse but the system mouse is unable to be warped (e.g. because the window is not focused).