Radium Engine
1.5.20
|
This class manage a collection of binding/callback associated with a context. More...
#include <Gui/Utils/KeyMappingManager.hpp>
Public Types | |
using | Context = KeyMappingManager::Context |
using | KeyMappingAction = KeyMappingManager::KeyMappingAction |
using | Callback = std::function<void( QEvent* )> |
Public Member Functions | |
KeyMappingCallbackManager (Context context) | |
void | addEventCallback (KeyMappingAction action, Callback callback) |
KeyMappingManager::KeyMappingAction | addActionAndCallback (const std::string &actionName, const KeyMappingManager::EventBinding &binding, Callback callback) |
bool | triggerEventCallback (QEvent *event, int key, bool wheel=false) |
bool | triggerEventCallback (KeyMappingAction action, QEvent *event) |
This class manage a collection of binding/callback associated with a context.
Typical usage is to have one instance of this class is a KeyMappingManageable class to ease callback triggering.
Definition at line 269 of file KeyMappingManager.hpp.
using Ra::Gui::KeyMappingCallbackManager::Callback = std::function<void( QEvent* )> |
Definition at line 274 of file KeyMappingManager.hpp.
using Ra::Gui::KeyMappingCallbackManager::Context = KeyMappingManager::Context |
Definition at line 272 of file KeyMappingManager.hpp.
using Ra::Gui::KeyMappingCallbackManager::KeyMappingAction = KeyMappingManager::KeyMappingAction |
Definition at line 273 of file KeyMappingManager.hpp.
|
inlineexplicit |
Create a callback manager for a given context.
Definition at line 323 of file KeyMappingManager.hpp.
|
inline |
First add the action from its name to the KeyMappingManager, the set the callback for this new action.
Definition at line 332 of file KeyMappingManager.hpp.
|
inline |
Set the callback for a given action. Previously set callback, if any, is removed.
Definition at line 326 of file KeyMappingManager.hpp.
|
inline |
Triggers the callback, if any, corresponding to the action.
Definition at line 342 of file KeyMappingManager.hpp.
|
inline |
Triggers the callback, if any, corresponding to the binding.
Definition at line 350 of file KeyMappingManager.hpp.