Castor3D
..
|
Classe utilisée pour gérer les évènements utilisateur. Plus de détails...
Types publics | |
using | OnClickActionFunction = std::function< void() > |
using | OnSelectActionFunction = std::function< void(int) > |
using | OnTextActionFunction = std::function< void(castor::String const &) > |
Fonctions membres publiques | |
Output events | |
C3D_API void | registerClickAction (castor::String const &p_handler, OnClickActionFunction p_function) |
C3D_API void | registerSelectAction (castor::String const &p_handler, OnSelectActionFunction p_function) |
C3D_API void | registerTextAction (castor::String const &p_handler, OnTextActionFunction p_function) |
C3D_API void | unregisterClickAction (castor::String const &p_handler) |
C3D_API void | unregisterSelectAction (castor::String const &p_handler) |
C3D_API void | unregisterTextAction (castor::String const &p_handler) |
C3D_API void | onClickAction (castor::String const &p_handler) |
C3D_API void | onSelectAction (castor::String const &p_handler, int p_index) |
C3D_API void | onTextAction (castor::String const &p_handler, castor::String const &p_text) |
Mouse input events | |
C3D_API bool | fireMouseMove (castor::Position const &p_position) |
C3D_API bool | fireMouseButtonPushed (MouseButton p_button) |
C3D_API bool | fireMouseButtonReleased (MouseButton p_button) |
C3D_API bool | fireMouseWheel (castor::Position const &p_offsets) |
Keyboard input events | |
C3D_API bool | fireKeydown (KeyboardKey p_key, bool p_ctrl, bool p_alt, bool p_shift) |
C3D_API bool | fireKeyUp (KeyboardKey p_key, bool p_ctrl, bool p_alt, bool p_shift) |
C3D_API bool | fireChar (KeyboardKey p_key, castor::String const &p_char) |
Overlay events | |
virtual C3D_API bool | fireMaterialEvent (castor::String const &p_overlay, castor::String const &p_material) |
virtual C3D_API bool | fireTextEvent (castor::String const &p_overlay, castor::String const &p_caption) |
Fonctions membres protégées | |
std::vector< EventHandlerSPtr > | doGetHandlers () const |
bool | doHasHandlers () const |
void | doAddHandler (EventHandlerSPtr p_handler) |
void | doRemoveHandler (EventHandlerSPtr p_handler) |
Attributs protégés | |
std::mutex | m_mutexHandlers |
std::vector< EventHandlerSPtr > | m_handlers |
FrameListenerSPtr | m_frameListener |
General | |
C3D_API | UserInputListener (Engine &engine, castor::String const &p_name) |
virtual C3D_API | ~UserInputListener () |
C3D_API bool | initialise () |
C3D_API void | cleanup () |
C3D_API void | processEvents () |
castor::Position const & | getMousePosition () const |
EventHandlerSPtr | getActiveControl () const |
EventHandlerSPtr | getFocusedControl () const |
Classe utilisée pour gérer les évènements utilisateur.
using castor3d::UserInputListener::OnClickActionFunction = std::function< void() > |
using castor3d::UserInputListener::OnSelectActionFunction = std::function< void( int ) > |
using castor3d::UserInputListener::OnTextActionFunction = std::function< void( castor::String const & ) > |
C3D_API castor3d::UserInputListener::UserInputListener | ( | Engine & | engine, |
castor::String const & | p_name | ||
) |
|
virtual |
C3D_API void castor3d::UserInputListener::cleanup | ( | ) |
|
inlineprotected |
Références m_handlers, et m_mutexHandlers.
|
inlineprotected |
Références m_handlers, et m_mutexHandlers.
|
inlineprotected |
true
s'il y a des gestionnaires. Références m_handlers, et m_mutexHandlers.
|
inlineprotected |
Références C3D_API, m_handlers, et m_mutexHandlers.
C3D_API bool castor3d::UserInputListener::fireChar | ( | KeyboardKey | p_key, |
castor::String const & | p_char | ||
) |
C3D_API bool castor3d::UserInputListener::fireKeydown | ( | KeyboardKey | p_key, |
bool | p_ctrl, | ||
bool | p_alt, | ||
bool | p_shift | ||
) |
C3D_API bool castor3d::UserInputListener::fireKeyUp | ( | KeyboardKey | p_key, |
bool | p_ctrl, | ||
bool | p_alt, | ||
bool | p_shift | ||
) |
|
virtual |
C3D_API bool castor3d::UserInputListener::fireMouseButtonPushed | ( | MouseButton | p_button | ) |
C3D_API bool castor3d::UserInputListener::fireMouseButtonReleased | ( | MouseButton | p_button | ) |
C3D_API bool castor3d::UserInputListener::fireMouseMove | ( | castor::Position const & | p_position | ) |
C3D_API bool castor3d::UserInputListener::fireMouseWheel | ( | castor::Position const & | p_offsets | ) |
|
virtual |
|
inline |
|
inline |
Références C3D_API, fireChar(), fireKeydown(), fireKeyUp(), fireMaterialEvent(), fireMouseButtonPushed(), fireMouseButtonReleased(), fireMouseMove(), fireMouseWheel(), fireTextEvent(), onClickAction(), onSelectAction(), onTextAction(), registerClickAction(), registerSelectAction(), registerTextAction(), unregisterClickAction(), unregisterSelectAction(), et unregisterTextAction().
|
inline |
Références castor3d::MouseState::m_position.
C3D_API bool castor3d::UserInputListener::initialise | ( | ) |
C3D_API void castor3d::UserInputListener::onClickAction | ( | castor::String const & | p_handler | ) |
C3D_API void castor3d::UserInputListener::onSelectAction | ( | castor::String const & | p_handler, |
int | p_index | ||
) |
C3D_API void castor3d::UserInputListener::onTextAction | ( | castor::String const & | p_handler, |
castor::String const & | p_text | ||
) |
C3D_API void castor3d::UserInputListener::processEvents | ( | ) |
C3D_API void castor3d::UserInputListener::registerClickAction | ( | castor::String const & | p_handler, |
OnClickActionFunction | p_function | ||
) |
C3D_API void castor3d::UserInputListener::registerSelectAction | ( | castor::String const & | p_handler, |
OnSelectActionFunction | p_function | ||
) |
C3D_API void castor3d::UserInputListener::registerTextAction | ( | castor::String const & | p_handler, |
OnTextActionFunction | p_function | ||
) |
C3D_API void castor3d::UserInputListener::unregisterClickAction | ( | castor::String const & | p_handler | ) |
C3D_API void castor3d::UserInputListener::unregisterSelectAction | ( | castor::String const & | p_handler | ) |
C3D_API void castor3d::UserInputListener::unregisterTextAction | ( | castor::String const & | p_handler | ) |
|
protected |
Le frame listener associé.
|
protected |
Le tableau de gestionnaires.
Référencé par doAddHandler(), doGetHandlers(), doHasHandlers(), et doRemoveHandler().
|
mutableprotected |
Le mutex de protection du tableau de gestionnaires.
Référencé par doAddHandler(), doGetHandlers(), doHasHandlers(), et doRemoveHandler().