VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Types | Protected Slots | Protected Member Functions | Protected Attributes
makVrf::DtVrfMenuKeyMapManager Class Reference

This class will traverse the created actions in the menu system and add a potential key mapping for them. The mechanism will replace the Qt shortcut mechanism in that it will handle the triggering of the actions.

Inheritance diagram for makVrf::DtVrfMenuKeyMapManager:
Inheritance graph
[legend]

Public Member Functions

 DtVrfMenuKeyMapManager (makVrv::DtDe &)
 
virtual ~DtVrfMenuKeyMapManager () override
 
virtual void setup ()
 
virtual void addNonFocusKeyMapFunction (const std::string &)
 
virtual void removeNonFocusKeyMapFunction (const std::string &)
 
virtual void addKeyboardMenuMapping (const makVrv::DtMenuPath &path, const makVrv::DtMenuManager *localMenuManager=nullptr, QAction *act=nullptr)
 
virtual void removeKeyboardMenuMapping (const makVrv::DtMenuPath &path, const makVrv::DtMenuManager *localMenuManager=nullptr, QAction *act=nullptr)
 
virtual void setApplyChangesToAllKeymaps (bool)
 
virtual bool applyChangesToAllKeymaps () const
 
virtual bool isMenuFunction (const std::string &func) const
 
virtual QString reverseTranslate (const QString &) const
 
virtual void copyKeyFunction (const makVrv::DtMenuPath &from, const makVrv::DtMenuPath &to)
 
virtual bool setSaveManagersOnChange (bool)
 
virtual bool saveManagersOnChange () const
 
virtual bool hasActionToProcessNonFocusKey (const QKeySequence &)
 
virtual QString keyStateToKeySequence (const makVrv::DtKeyState &) const
 
virtual QString actionTypeToKeySequence (int) const
 
virtual makVrv::DtKeyEvent vrvKeyEventFromQtKeyEvent (const QKeyEvent &e) const
 
virtual makVrv::DtKeyState::KeyType qtKeyEventToVrvKey (const QKeyEvent &) const
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Static Public Member Functions

static DtVrfMenuKeyMapManagerinstance (makVrv::DtDe &de)
 
static void registerInstance (makVrv::DtDe &, DtVrfMenuKeyMapManager *)
 

Protected Types

typedef std::map< std::string,
std::map< std::string, QAction * > > 
FunctionToPathMap
 
typedef std::map< std::string,
std::string > 
PathToFunctionMap
 
typedef std::map< std::string,
int
FunctionCategoryMap
 
typedef std::map< int,
std::pair< std::string,
QAction * > > 
ActionTypeToPathMap
 

Protected Slots

virtual void actionDestroyed ()
 

Protected Member Functions

virtual bool eventFilter (QObject *, QEvent *) override
 
virtual std::string menuPathToFunctionName (const makVrv::DtMenuPath &, const makVrv::DtMenuManager *localMenuManager=nullptr) const
 
virtual void slot_triggerShortcut (makVrv::DtMenuPath, const makVrv::DtMenuManager *localMenuManager=nullptr)
 
virtual void setKeyMap (makVrv::DtKeyMapManager *, std::string currentMap)
 
virtual void manageChangeableMenu (const std::string &menuId)
 
virtual void setupChangeableMenus ()
 
virtual void preAssembleConfigurableMenu (DtAssembledMenu *)
 
virtual void postAssembleConfigurableMenu (DtAssembledMenu *)
 
virtual int mapPathToKeymapFunctionCategory (const std::string &path)
 
virtual void keyMappingRemoved (makVrv::DtKeyMap *, std::string, makVrv::DtKeyState::KeyType, makVrv::DtKeyEvent::KeyEventType, makVrv::DtKeyState::KeyModifier)
 
virtual void keyMappingModified (makVrv::DtKeyMap *, std::string, makVrv::DtKeyState::KeyType, makVrv::DtKeyEvent::KeyEventType, makVrv::DtKeyState::KeyModifier)
 
virtual bool setupKeyMappingFor (const std::string &path, QAction *action, makVrv::DtKeyMap *map)
 
virtual void resetShortcut (makVrv::DtKeyMap *, std::string)
 
void parseTSFile (const QString &file)
 
virtual void zoomToExtents ()
 

Protected Attributes

makVrv::DtDemyDe
 
makVrv::DtSignalConnectionManager myConnectionManager
 
std::map< QKeySequence,
std::set< QAction * > > 
myShortcuts
 
std::map< QKeySequence,
std::string > 
myNonFocusShortcutsByKeySequence
 
std::set< std::string > myNonFocusShortcuts
 
FunctionToPathMap myFunctionToPathMap
 
PathToFunctionMap myPathToFunctionMap
 
FunctionCategoryMap myFunctionCategories
 
ActionTypeToPathMap myActionTypeToPathMap
 
bool myApplyChangesToAllKeymaps
 
std::map< QString, QString > myReverseMap
 
bool mySaveManagersOnChange
 
std::string myCurrentKeyMap
 
bool mySetupChanged
 

Member Typedef Documentation

typedef std::map<std::string, std::map<std::string, QAction*> > makVrf::DtVrfMenuKeyMapManager::FunctionToPathMap
protected
typedef std::map<std::string, std::string> makVrf::DtVrfMenuKeyMapManager::PathToFunctionMap
protected
typedef std::map<std::string, int> makVrf::DtVrfMenuKeyMapManager::FunctionCategoryMap
protected
typedef std::map<int, std::pair<std::string, QAction*> > makVrf::DtVrfMenuKeyMapManager::ActionTypeToPathMap
protected

Constructor & Destructor Documentation

makVrf::DtVrfMenuKeyMapManager::DtVrfMenuKeyMapManager ( makVrv::DtDe )
virtual makVrf::DtVrfMenuKeyMapManager::~DtVrfMenuKeyMapManager ( )
overridevirtual

Member Function Documentation

static DtVrfMenuKeyMapManager& makVrf::DtVrfMenuKeyMapManager::instance ( makVrv::DtDe de)
static

Returns instance of the manager.

static void makVrf::DtVrfMenuKeyMapManager::registerInstance ( makVrv::DtDe ,
DtVrfMenuKeyMapManager  
)
static
virtual void makVrf::DtVrfMenuKeyMapManager::setup ( )
virtual

Will setup the key mappings by iterating over the menu configuration and then calling addKeyboardMenuMapping with that path.

virtual void makVrf::DtVrfMenuKeyMapManager::addNonFocusKeyMapFunction ( const std::string &  )
virtual

If there is a key map function that is not part of the menu system, and you want that function to be available to widgets that process non focused to the main widget keyboard events, add that function here.

virtual void makVrf::DtVrfMenuKeyMapManager::removeNonFocusKeyMapFunction ( const std::string &  )
virtual
virtual void makVrf::DtVrfMenuKeyMapManager::addKeyboardMenuMapping ( const makVrv::DtMenuPath path,
const makVrv::DtMenuManager localMenuManager = nullptr,
QAction act = nullptr 
)
virtual

Adds a new keyboard mapping for the particular path.

virtual void makVrf::DtVrfMenuKeyMapManager::removeKeyboardMenuMapping ( const makVrv::DtMenuPath path,
const makVrv::DtMenuManager localMenuManager = nullptr,
QAction act = nullptr 
)
virtual

Removes a keyboard menu map with a particular path.

virtual void makVrf::DtVrfMenuKeyMapManager::setApplyChangesToAllKeymaps ( bool  )
virtual

Sets whether or not to apply changes made here to all keymaps. Default is true.

virtual bool makVrf::DtVrfMenuKeyMapManager::applyChangesToAllKeymaps ( ) const
virtual
virtual bool makVrf::DtVrfMenuKeyMapManager::isMenuFunction ( const std::string &  func) const
virtual

Returns true if this keyboard function is a menu function.

virtual QString makVrf::DtVrfMenuKeyMapManager::reverseTranslate ( const QString &  ) const
virtual

Reverse the translation to the original english text.

virtual void makVrf::DtVrfMenuKeyMapManager::copyKeyFunction ( const makVrv::DtMenuPath from,
const makVrv::DtMenuPath to 
)
virtual

Copied the keyboard functions from the specied to the specified path.

virtual bool makVrf::DtVrfMenuKeyMapManager::setSaveManagersOnChange ( bool  )
virtual

If there are any changes to the key map manager, save them or not. Default is true.

virtual bool makVrf::DtVrfMenuKeyMapManager::saveManagersOnChange ( ) const
virtual
virtual bool makVrf::DtVrfMenuKeyMapManager::hasActionToProcessNonFocusKey ( const QKeySequence &  )
virtual
virtual QString makVrf::DtVrfMenuKeyMapManager::keyStateToKeySequence ( const makVrv::DtKeyState ) const
virtual
virtual QString makVrf::DtVrfMenuKeyMapManager::actionTypeToKeySequence ( int  ) const
virtual
virtual makVrv::DtKeyEvent makVrf::DtVrfMenuKeyMapManager::vrvKeyEventFromQtKeyEvent ( const QKeyEvent &  e) const
virtual
virtual makVrv::DtKeyState::KeyType makVrf::DtVrfMenuKeyMapManager::qtKeyEventToVrvKey ( const QKeyEvent &  ) const
virtual
virtual void makVrf::DtVrfMenuKeyMapManager::actionDestroyed ( )
protectedvirtualslot
virtual bool makVrf::DtVrfMenuKeyMapManager::eventFilter ( QObject ,
QEvent  
)
overrideprotectedvirtual

This event filter will accept all shortcut events to prevent the Qt system from handling them.

virtual std::string makVrf::DtVrfMenuKeyMapManager::menuPathToFunctionName ( const makVrv::DtMenuPath ,
const makVrv::DtMenuManager localMenuManager = nullptr 
) const
protectedvirtual

Given a menu path returns a function name for that path. If the path is not an item or not found returns empty string.

virtual void makVrf::DtVrfMenuKeyMapManager::slot_triggerShortcut ( makVrv::DtMenuPath  ,
const makVrv::DtMenuManager localMenuManager = nullptr 
)
protectedvirtual

Called when a shortcut is triggered, finds the associated action and triggers it.

virtual void makVrf::DtVrfMenuKeyMapManager::setKeyMap ( makVrv::DtKeyMapManager ,
std::string  currentMap 
)
protectedvirtual

Sets the current key map and looks for function name mappings to map from function to actions to set shortcuts.

virtual void makVrf::DtVrfMenuKeyMapManager::manageChangeableMenu ( const std::string &  menuId)
protectedvirtual

Will add a new menu to manage keyboard mappings for. This menu is a menu that is of type DtConfigurableMenu and is expected to change it's menu contents over the lifetime of the application. Once managed it cannot be unmanaged.

virtual void makVrf::DtVrfMenuKeyMapManager::setupChangeableMenus ( )
protectedvirtual

The following menu items are different in that they are created/destroyed via the changing or loading of th scenario, so, they need to be handled differently.

virtual void makVrf::DtVrfMenuKeyMapManager::preAssembleConfigurableMenu ( DtAssembledMenu )
protectedvirtual

Sent before a configurable menu is assembled. This will remove all old key mapping functions.

virtual void makVrf::DtVrfMenuKeyMapManager::postAssembleConfigurableMenu ( DtAssembledMenu )
protectedvirtual

Sent after a configurable menu is assembled. This will add all key mapping functions.

virtual int makVrf::DtVrfMenuKeyMapManager::mapPathToKeymapFunctionCategory ( const std::string &  path)
protectedvirtual

Maps a path by finding the root menu to a function category. If category does not exist a new map is created.

virtual void makVrf::DtVrfMenuKeyMapManager::keyMappingRemoved ( makVrv::DtKeyMap ,
std::string  ,
makVrv::DtKeyState::KeyType  ,
makVrv::DtKeyEvent::KeyEventType  ,
makVrv::DtKeyState::KeyModifier   
)
protectedvirtual

Received when a key mapping is removed. If action that represents the keymap has a shortcut for that, then set that shortcut to empty.

virtual void makVrf::DtVrfMenuKeyMapManager::keyMappingModified ( makVrv::DtKeyMap ,
std::string  ,
makVrv::DtKeyState::KeyType  ,
makVrv::DtKeyEvent::KeyEventType  ,
makVrv::DtKeyState::KeyModifier   
)
protectedvirtual

Received when a key mapping is modified. If action that represents that function does not have a shortcut already assigned to it, set it to be the shortcut.

virtual bool makVrf::DtVrfMenuKeyMapManager::setupKeyMappingFor ( const std::string &  path,
QAction action,
makVrv::DtKeyMap map 
)
protectedvirtual

Sets up a shortcut for the given action, key map and menu path.

virtual void makVrf::DtVrfMenuKeyMapManager::resetShortcut ( makVrv::DtKeyMap ,
std::string   
)
protectedvirtual

Resets the shortcut for the particular function string changed in the supplied keymap. Will only reset if the key map supplied is the current selected one.

void makVrf::DtVrfMenuKeyMapManager::parseTSFile ( const QString &  file)
protected
virtual void makVrf::DtVrfMenuKeyMapManager::zoomToExtents ( )
protectedvirtual

Member Data Documentation

makVrv::DtDe& makVrf::DtVrfMenuKeyMapManager::myDe
protected
makVrv::DtSignalConnectionManager makVrf::DtVrfMenuKeyMapManager::myConnectionManager
protected
std::map<QKeySequence, std::set<QAction*> > makVrf::DtVrfMenuKeyMapManager::myShortcuts
protected
std::map<QKeySequence, std::string> makVrf::DtVrfMenuKeyMapManager::myNonFocusShortcutsByKeySequence
protected
std::set<std::string> makVrf::DtVrfMenuKeyMapManager::myNonFocusShortcuts
protected
FunctionToPathMap makVrf::DtVrfMenuKeyMapManager::myFunctionToPathMap
protected
PathToFunctionMap makVrf::DtVrfMenuKeyMapManager::myPathToFunctionMap
protected
FunctionCategoryMap makVrf::DtVrfMenuKeyMapManager::myFunctionCategories
protected
ActionTypeToPathMap makVrf::DtVrfMenuKeyMapManager::myActionTypeToPathMap
protected
bool makVrf::DtVrfMenuKeyMapManager::myApplyChangesToAllKeymaps
protected
std::map<QString, QString> makVrf::DtVrfMenuKeyMapManager::myReverseMap
protected
bool makVrf::DtVrfMenuKeyMapManager::mySaveManagersOnChange
protected
std::string makVrf::DtVrfMenuKeyMapManager::myCurrentKeyMap
protected
bool makVrf::DtVrfMenuKeyMapManager::mySetupChanged
protected

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)