Castor3D 0.16.0
Multiplatform 3D engine
|
#include <EventHandler.hpp>
Public Types | |
using | ClientMouseFunction = castor::Function< void( MouseEvent const & ) > |
using | ClientKeyboardFunction = castor::Function< void( KeyboardEvent const & ) > |
using | ClientHandlerFunction = castor::Function< void( HandlerEvent const & ) > |
using | EnableFunction = castor::Function< void( bool ) > |
using | OnClientMouseEvent = castor::SignalT< ClientMouseFunction > |
using | OnClientKeyboardEvent = castor::SignalT< ClientKeyboardFunction > |
using | OnClientHandlerEvent = castor::SignalT< ClientHandlerFunction > |
using | OnEnable = castor::SignalT< EnableFunction > |
using | OnClientMouseEventConnection = OnClientMouseEvent::connection |
using | OnClientKeyboardEventConnection = OnClientKeyboardEvent::connection |
using | OnClientHandlerEventConnection = OnClientHandlerEvent::connection |
using | OnEnableConnection = OnEnable::connection |
Public Member Functions | |
Mouse events | |
void | pushEvent (MouseEvent const &event) |
Adds a mouse event to the events queue. | |
void | connect (MouseEventType event, ClientMouseFunction function) |
Connects a function to a mouse event. | |
bool | catchesMouseEvents () const |
Tells if the control catches mouse events. | |
void | setCatchesMouseEvents (bool value) |
Sets if the control can catch mouse events. | |
Keyboard events | |
void | pushEvent (KeyboardEvent const &event) |
Adds a keyboard event to the events queue. | |
void | connect (KeyboardEventType event, ClientKeyboardFunction function) |
Connects a function to a keyboard event. | |
bool | catchesTabKey () const |
Tells if the control catches 'tab' key. | |
bool | catchesReturnKey () const |
Tells if the control catches 'return' key. | |
Public Member Functions inherited from castor::NamedBaseT< T > | |
NamedBaseT (T name) noexcept | |
Constructor. | |
T const & | getName () const noexcept |
Retrieves the name. | |
void | rename (T name) noexcept |
Protected Types | |
using | EventHandlerFunction = castor::Function< void() > |
using | EventQueue = castor::Deque< castor::Pair< UserInputEventSPtr, EventHandlerFunction > > |
General | |
OnEnable | onEnable |
EventHandler (castor::String const &name, bool catchMouseEvents) | |
Constructor. | |
virtual | ~EventHandler () noexcept |
Destructor. | |
void | processEvents () |
Processes all queued events. | |
bool | isEnabled () const |
void | enable () |
Sets if the control is enabled. | |
void | disable () |
Sets if the control is disabled. | |
Additional Inherited Members | |
Protected Attributes inherited from castor::NamedBaseT< T > | |
T | m_name |
using castor3d::EventHandler::ClientHandlerFunction = castor::Function< void( HandlerEvent const & ) > |
Catcher definition for handler events.
using castor3d::EventHandler::ClientKeyboardFunction = castor::Function< void( KeyboardEvent const & ) > |
Catcher definition for keyboard events.
using castor3d::EventHandler::ClientMouseFunction = castor::Function< void( MouseEvent const & ) > |
Catcher definition for mouse events.
using castor3d::EventHandler::EnableFunction = castor::Function< void( bool ) > |
Signal function when handler is enabled/disabled.
|
protected |
|
protected |
Handler event signal definition.
using castor3d::EventHandler::OnClientHandlerEventConnection = OnClientHandlerEvent::connection |
Handler event signal connection definition.
Keyboard event signal definition.
using castor3d::EventHandler::OnClientKeyboardEventConnection = OnClientKeyboardEvent::connection |
Keyboard event signal connection definition.
Mouse event signal definition.
using castor3d::EventHandler::OnClientMouseEventConnection = OnClientMouseEvent::connection |
Mouse event signal connection definition.
Signal when handler is enabled/disabled.
Signal connection when handler is enabled/disabled.
|
inlineexplicit |
Constructor.
[in] | name | The handler name. |
[in] | catchMouseEvents | Defines if the event handler catches mouse event. |
|
inlinevirtualnoexcept |
|
inline |
Tells if the control catches mouse events.
|
inline |
Tells if the control catches 'return' key.
|
inline |
Tells if the control catches 'tab' key.
|
inline |
Connects a function to a handler event.
[in] | event | The event type. |
[in] | function | The function. |
References connect(), m_handlerSlots, and m_handlerSlotsConnections.
|
inline |
Connects a function to a keyboard event.
[in] | event | The event type. |
[in] | function | The function. |
References connect(), m_keyboardSlots, and m_keyboardSlotsConnections.
|
inline |
Connects a function to a mouse event.
[in] | event | The event type. |
[in] | function | The function. |
References connect(), m_mouseSlots, and m_mouseSlotsConnections.
Referenced by connect(), connect(), connect(), castor3d::NonClientEventHandler< Derived >::connectNC(), castor3d::NonClientEventHandler< Derived >::connectNC(), and castor3d::NonClientEventHandler< Derived >::connectNC().
|
inline |
Sets if the control is disabled.
References onEnable.
|
inline |
Sets if the control is enabled.
References onEnable.
|
inline |
false
if the control is disabled.
|
inline |
Processes all queued events.
|
inlineprotected |
Handler event processing function.
[in] | event | The event. |
References m_handlerSlots.
Referenced by pushEvent().
|
inlineprotected |
Keyboard event processing function.
[in] | event | The event. |
References m_keyboardSlots.
Referenced by pushEvent().
|
inlineprotected |
Mouse event processing function.
[in] | event | The event. |
References m_mouseSlots.
Referenced by pushEvent().
|
inline |
Adds a handler event to the events queue.
[in] | event | The mouse event. |
References castor::makeUniqueLock(), and processHandlerEvent().
|
inline |
Adds a keyboard event to the events queue.
[in] | event | The mouse event. |
References castor::makeUniqueLock(), and processKeyboardEvent().
|
inline |
Adds a mouse event to the events queue.
[in] | event | The mouse event. |
References castor::makeUniqueLock(), and processMouseEvent().
|
inline |
Sets if the control can catch mouse events.
[in] | value | The new value. |
|
protected |
The handler events slots.
Referenced by connect(), and processHandlerEvent().
|
protected |
The handler events slots connections.
Referenced by connect().
|
protected |
The keyboard events slots.
Referenced by connect(), and processKeyboardEvent().
|
protected |
The keyboard events slots connections.
Referenced by connect().
|
protected |
The mouse events slots.
Referenced by connect(), and processMouseEvent().
|
protected |
The mouse events slots connections.
Referenced by connect().