Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Gui::KeyMappingCallbackManager Class Reference

This class manage a collection of binding/callback associated with a context. More...

#include <Gui/Utils/KeyMappingManager.hpp>

+ Collaboration diagram for Ra::Gui::KeyMappingCallbackManager:

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)
 

Detailed Description

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.

Member Typedef Documentation

◆ Callback

Definition at line 274 of file KeyMappingManager.hpp.

◆ Context

using Ra::Gui::KeyMappingCallbackManager::Context = KeyMappingManager::Context

Definition at line 272 of file KeyMappingManager.hpp.

◆ KeyMappingAction

using Ra::Gui::KeyMappingCallbackManager::KeyMappingAction = KeyMappingManager::KeyMappingAction

Definition at line 273 of file KeyMappingManager.hpp.

Constructor & Destructor Documentation

◆ KeyMappingCallbackManager()

Ra::Gui::KeyMappingCallbackManager::KeyMappingCallbackManager ( Context context)
inlineexplicit

Create a callback manager for a given context.

Definition at line 323 of file KeyMappingManager.hpp.

Member Function Documentation

◆ addActionAndCallback()

KeyMappingManager::KeyMappingAction Ra::Gui::KeyMappingCallbackManager::addActionAndCallback ( const std::string & actionName,
const KeyMappingManager::EventBinding & binding,
Callback callback )
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.

+ Here is the call graph for this function:

◆ addEventCallback()

void Ra::Gui::KeyMappingCallbackManager::addEventCallback ( KeyMappingAction action,
Callback callback )
inline

Set the callback for a given action. Previously set callback, if any, is removed.

Definition at line 326 of file KeyMappingManager.hpp.

◆ triggerEventCallback() [1/2]

bool Ra::Gui::KeyMappingCallbackManager::triggerEventCallback ( KeyMappingAction action,
QEvent * event )
inline

Triggers the callback, if any, corresponding to the action.

Definition at line 342 of file KeyMappingManager.hpp.

◆ triggerEventCallback() [2/2]

bool Ra::Gui::KeyMappingCallbackManager::triggerEventCallback ( QEvent * event,
int key,
bool wheel = false )
inline

Triggers the callback, if any, corresponding to the binding.

Definition at line 350 of file KeyMappingManager.hpp.

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: