Input system, centralizing default behaviour for the input. More...
Public Member Functions | |
void | registerToTrack (EVENT_TYPE eventType, Component *component) |
void | unregisterTracking (EVENT_TYPE eventType, Component *component) |
void | requestWindowFollow (Component *caller, bool value) |
std::function< bool(Component *)> | getCloseCallback () const |
std::function< void(Component *, bool)> | getVisibilityCallback () const |
std::function< void(Component *, const ClickEventData &)> | getClickCallback () const |
std::function< void(Component *, const WheelEventData &)> | getWheelCallback () const |
std::function< void(Component *, const KeyEventData &)> | getKeyCallback () const |
const std::unordered_map< Component *, std::pair< bool, bool > > & | getFollowedWindows () const |
void | setCloseCallback (std::function< bool(Component *caller)> callback) |
void | setVisibilityCallback (std::function< void(Component *caller, bool visibility)> callback) |
void | setClickCallback (std::function< void(Component *caller, const ClickEventData &eventData)> callback) |
void | setWheelCallback (std::function< void(Component *caller, const WheelEventData &eventData)> callback) |
void | setKeyCallback (std::function< void(Component *caller, const KeyEventData &eventData)> callback) |
Input system, centralizing default behaviour for the input.
void nkWinUi::InputSystem::registerToTrack | ( | EVENT_TYPE | eventType, |
Component * | component | ||
) |
Register a component for it to listen to events of some kind even if not focused.
eventType | The type of event to listen to. |
component | The component needing to listen. |
void nkWinUi::InputSystem::unregisterTracking | ( | EVENT_TYPE | eventType, |
Component * | component | ||
) |
Unregister a component from listening to an event kind.
eventType | The type of event the component needs to stop listening to. |
component | The component needing to stop following the events. |
void nkWinUi::InputSystem::requestWindowFollow | ( | Component * | caller, |
bool | value | ||
) |
Requests a tracking to know when a mouse is leaving a component.
caller | The component that needs to follow the mouse leaving it. |
value | If the tracking needs to occur (true) or not (false). |
std::function<bool (Component*)> nkWinUi::InputSystem::getCloseCallback | ( | ) | const |
std::function<void (Component*, bool)> nkWinUi::InputSystem::getVisibilityCallback | ( | ) | const |
std::function<void (Component*, const ClickEventData&)> nkWinUi::InputSystem::getClickCallback | ( | ) | const |
std::function<void (Component*, const WheelEventData&)> nkWinUi::InputSystem::getWheelCallback | ( | ) | const |
std::function<void (Component*, const KeyEventData&)> nkWinUi::InputSystem::getKeyCallback | ( | ) | const |
const std::unordered_map<Component*, std::pair<bool, bool> >& nkWinUi::InputSystem::getFollowedWindows | ( | ) | const |
void nkWinUi::InputSystem::setCloseCallback | ( | std::function< bool(Component *caller)> | callback | ) |
Sets the global UI component close callback to use. This function will be the fallback for all components not having a dedicated callback.
callback | The callback to use. |
void nkWinUi::InputSystem::setVisibilityCallback | ( | std::function< void(Component *caller, bool visibility)> | callback | ) |
Sets the global UI visibility change callback to use. This function will be the fallback for all components not having a dedicated callback.
callback | The callback to use. |
void nkWinUi::InputSystem::setClickCallback | ( | std::function< void(Component *caller, const ClickEventData &eventData)> | callback | ) |
Sets the global mouse click callback to use. This function will be the fallback for all components not having a dedicated callback.
callback | The callback to use. |
void nkWinUi::InputSystem::setWheelCallback | ( | std::function< void(Component *caller, const WheelEventData &eventData)> | callback | ) |
Sets the global mouse wheel callback to use. This function will be the fallback for all components not having a dedicated callback.
callback | The callback to use. |
void nkWinUi::InputSystem::setKeyCallback | ( | std::function< void(Component *caller, const KeyEventData &eventData)> | callback | ) |
Sets the global keyboard key callback to use. This function will be the fallback for all components not having a dedicated callback.
callback | The callback to use. |