22 #ifndef FIFE_EVENTCHANNEL_EVENTMANAGER_H 23 #define FIFE_EVENTCHANNEL_EVENTMANAGER_H 67 class ICommandListener;
69 class IJoystickListener;
71 class JoystickManager;
214 bool combineEvents(SDL_Event& event1,
const SDL_Event& event2);
bool isMouseAccelerationEnabled() const
Returns if mouse acceleration is enabled or not.
void removeMouseListener(IMouseListener *listener)
Removes an added listener from the controller.
void setClipboardText(const std::string &text)
Sets clipboard text.
std::deque< ITextListener * > m_textListeners
void addKeyListenerFront(IKeyListener *listener)
Adds a listener to the front of the listener deque Listener will be notified via the corresponding ev...
void saveGamepadMappings(const std::string &file)
Saves all controller mappings that were used during the season.
void saveGamepadMapping(const std::string guid, const std::string &file)
Saves controller mapping for given GUID in the specified file.
Controller provides a way to receive events from the system Using this interface, clients can subscri...
void addTextListenerFront(ITextListener *listener)
Adds a listener to the front of the listener deque Listener will be notified via the corresponding ev...
Controller provides a way to receive events from the system Using this interface, clients can subscri...
Controller provides a way to receive events from the system Using this interface, clients can subscri...
Controller provides a way to receive events from the system Using this interface, clients can subscri...
Controller provides a way to receive events from the system Using this interface, clients can subscri...
bool combineEvents(SDL_Event &event1, const SDL_Event &event2)
Listener of command events.
void addJoystickListenerFront(IJoystickListener *listener)
std::deque< ICommandListener * > m_commandListeners
void removeJoystickListener(IJoystickListener *listener)
void addSdlEventListener(ISdlEventListener *listener)
Adds a listener to the back of the listener deque Listener will be notified via the corresponding eve...
void dispatchCommand(Command &command)
Use this method to send command to command listeners.
void addDropListener(IDropListener *listener)
Adds a listener to the back of the listener deque Listener will be notified via the corresponding eve...
void addCommandListenerFront(ICommandListener *listener)
Adds a listener to the front of the listener deque Listener will be notified via the corresponding ev...
Listener of mouse events.
void setMouseAccelerationEnabled(bool acceleration)
Sets mouse acceleration if mouse acceleration is enabled, then the mouse sensitivity is used as speed...
uint8_t getJoystickCount() const
Return the number of joysticks / gamecontrollers.
Listener of joystick events.
void dispatchDropEvent(DropEvent &evt)
void removeDropListener(IDropListener *listener)
Removes an added listener from the controller.
std::deque< IDropListener * > m_dropListeners
void addDropListenerFront(IDropListener *listener)
Adds a listener to the front of the listener deque Listener will be notified via the corresponding ev...
Represents a Joystick and if available the Gamecontroller.
Joystick * getJoystick(int32_t instanceId)
Return the joystick with the given instance id.
void removeCommandListener(ICommandListener *listener)
Removes an added listener from the controller.
void dispatchMouseEvent(MouseEvent &evt)
void processWindowEvent(SDL_Event event)
std::string getGamepadStringMapping(const std::string &guid)
Return the controller mapping for given GUID as string.
void addCommandListener(ICommandListener *listener)
Adds a listener to the back of the listener deque Listener will be notified via the corresponding eve...
Class for commands Commands are arbitrary events e.g.
Joystick Manager manages all events related to Joysticks and Gamecontrollers.
void processDropEvent(SDL_Event event)
std::deque< IMouseListener * > m_mouseListeners
void setGamepadStringMapping(const std::string &mapping)
Sets controller mapping from string and adds or updates the related controllers.
Controller provides a way to receive events from the system Using this interface, clients can subscri...
float getMouseSensitivity() const
Gets mouse sensitivity.
std::map< int32_t, bool > m_keystatemap
void fillMouseEvent(const SDL_Event &sdlevt, MouseEvent &mouseevt)
EventSourceType getEventSourceType()
Gets the source type of this event.
void setKeyFilter(IKeyFilter *keyFilter)
std::string getClipboardText() const
Returns the clipboard text as UTF-8 string.
void dispatchTextEvent(TextEvent &evt)
void processTextEvent(SDL_Event event)
void removeKeyListener(IKeyListener *listener)
Removes an added listener from the controller.
EventManager()
Constructor.
Event Manager manages all events related to FIFE.
void addJoystickListener(IJoystickListener *listener)
void fillKeyEvent(const SDL_Event &sdlevt, KeyEvent &keyevt)
JoystickManager * m_joystickManager
MouseButtonType
Mouse button types.
MouseEvent::MouseButtonType m_mostrecentbtn
void fillTextEvent(const SDL_Event &sdlevt, TextEvent &txtevt)
std::deque< ISdlEventListener * > m_sdleventListeners
void setJoystickSupport(bool support)
Sets the joystick support to enabled or disabled.
void addMouseListener(IMouseListener *listener)
Adds a listener to the back of the listener deque Listener will be notified via the corresponding eve...
void processKeyEvent(SDL_Event event)
virtual ~EventManager()
Destructor.
bool isClipboardText() const
Returns if clipboard have text or not.
bool dispatchSdlEvent(SDL_Event &evt)
EventSourceType
Types for different event sources.
void processMouseEvent(SDL_Event event)
void fillModifiers(InputEvent &evt)
void addSdlEventListenerFront(ISdlEventListener *listener)
Adds a listener to the front of the listener deque Listener will be notified via the corresponding ev...
void setMouseSensitivity(float sensitivity)
Sets mouse sensitivity The sensitivity is limited to the range -0.99 - 10.0.
Representation of event source (a thing sending events)
void processEvents()
Process the SDL event queue.
void addTextListener(ITextListener *listener)
Adds a listener to the back of the listener deque Listener will be notified via the corresponding eve...
void addMouseListenerFront(IMouseListener *listener)
Adds a listener to the front of the listener deque Listener will be notified via the corresponding ev...
Controller provides a way to receive events from the system Using this interface, clients can subscri...
std::deque< IKeyListener * > m_keyListeners
void loadGamepadMapping(const std::string &file)
Loads controller mappings from given file and if possible, it opens the related controllers.
void addKeyListener(IKeyListener *listener)
Adds a listener to the back of the listener deque Listener will be notified via the corresponding eve...
void dispatchKeyEvent(KeyEvent &evt)
void removeTextListener(ITextListener *listener)
Removes an added listener from the controller.
void removeSdlEventListener(ISdlEventListener *listener)
Removes an added listener from the controller.