VR-Forces 4.1.1 Class Documentation
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtKeyMap Class Reference

a Key Map contains a map of keys to FunctionMapEntrys, as well as a list of functions to execute when a key map is put into use and a list to execute when a key map is no longer used More...

Public Types

typedef std::map
< DtKeyState::KeyType,
DtKeyFunctionMapEntry * > 
KeyMap
typedef std::list< DtKeyMapping * > MappedKeyList

Public Member Functions

 DtKeyMap (const std::string &name, DtKeyMapManager &keyMapManager)
 CTOR.
virtual ~DtKeyMap ()
 DTOR.
 DtKeyMap (const DtKeyMap &orig)
 Copy Constructor (Deep copy)
DtKeyMapoperator= (const DtKeyMap &orig)
 Assignment Operator (Deep copy)
DtKeyMapclone (const std::string &newName)
 Create a new keymap based on this one.
const std::string & name () const
 the name of the map (required parameter to constructor)
void addKeyBinding (DtKeyState::KeyType key, std::string functionName, DtKeyState::KeyModifier modifiers=DtKeyState::NO_MODIFIER, bool replace=false, DtKeyEvent::KeyEventType eventType=DtKeyEvent::KEY_DOWN)
 bind a function name to a key/modifier/event type triple
virtual void removeKeyBinding (DtKeyState::KeyType key, std::string functionName, DtKeyState::KeyModifier modifiers=DtKeyState::NO_MODIFIER, DtKeyEvent::KeyEventType eventType=DtKeyEvent::KEY_DOWN)
void addBinaryKeyBinding (DtKeyState::KeyType key, std::string binaryName, DtKeyState::KeyModifier modifiers=DtKeyState::NO_MODIFIER, bool replace=false)
virtual void removeBinaryKeyBinding (DtKeyState::KeyType key, std::string functionName, DtKeyState::KeyModifier modifiers=DtKeyState::NO_MODIFIER)
DtKeyFunctionNameList getKeyFunctionNameList (const DtKeyEvent &keyEvent)
 Return the list of function names associated with this key event.
DtKeyFunctionMapEntryfindKeyFunctions (DtKeyState::KeyType key)
 get the map entry for specified key
virtual MappedKeyList findKeyMappings (const std::string &functionName)
 Get a list of the keys (and modifiers) that this function is mapped to in this KeyMap.
virtual MappedKeyList findBinaryKeyMappings (const std::string &functionName)
 Get a list of the keys (and modifiers) that this binary function is mapped to in this KeyMap.
void getRecord (makArchives::DtKeyMapRecord &record) const
 Get a record from this map.
void setFromRecord (const makArchives::DtKeyMapRecord &record)
 Set from a record.

Protected Member Functions

void buildReverseKeyMap ()
void determineParentFunctions ()
 Used by the reverse key map buider, it finds and sets the parent function of key mappings inherited from a parent binary function.
void processKeyFunctionSet (const DtKeyFunctionSet &functionSet, DtKeyState::KeyType keyType, DtKeyEvent::KeyEventType eventType)
void processKeyFunctionNameList (const DtKeyFunctionNameList &functionNames, DtKeyState::KeyType keyType, DtKeyEvent::KeyEventType eventType, DtKeyState::KeyModifier modifiers)
void processAddKeyBind (DtKeyFunctionNameList &functionList, std::string functionName, DtKeyState::KeyType keyType, DtKeyEvent::KeyEventType eventType, DtKeyState::KeyModifier modifiers, bool replace)
 This binds the function name into the function list for a specific key/modifier/ eventType triple.
void processRemoveKeyBind (DtKeyFunctionNameList &functionList, std::string functionName, DtKeyState::KeyType keyType, DtKeyEvent::KeyEventType eventType, DtKeyState::KeyModifier modifiers)
void processClearKeyBind (DtKeyFunctionNameList &functionList, DtKeyState::KeyType keyType, DtKeyEvent::KeyEventType eventType, DtKeyState::KeyModifier modifiers)
void copyMap (const KeyMap &orig)
void clearMap ()

Protected Attributes

std::string myName
KeyMap myKeyMap
DtReverseKeyMap myReverseKeyMap
DtKeyMapManagermyKeyMapManager

Private Member Functions

 DtKeyMap ()
 Default CTOR (not useable);.

Detailed Description

a Key Map contains a map of keys to FunctionMapEntrys, as well as a list of functions to execute when a key map is put into use and a list to execute when a key map is no longer used

Member Typedef Documentation

Constructor & Destructor Documentation

makVrv::DtKeyMap::DtKeyMap ( )
private

Default CTOR (not useable);.

makVrv::DtKeyMap::DtKeyMap ( const std::string &  name,
DtKeyMapManager keyMapManager 
)

CTOR.

virtual makVrv::DtKeyMap::~DtKeyMap ( )
virtual

DTOR.

makVrv::DtKeyMap::DtKeyMap ( const DtKeyMap orig)

Copy Constructor (Deep copy)

Member Function Documentation

DtKeyMap& makVrv::DtKeyMap::operator= ( const DtKeyMap orig)

Assignment Operator (Deep copy)

DtKeyMap* makVrv::DtKeyMap::clone ( const std::string &  newName)

Create a new keymap based on this one.

const std::string& makVrv::DtKeyMap::name ( void  ) const
inline

the name of the map (required parameter to constructor)

void makVrv::DtKeyMap::addKeyBinding ( DtKeyState::KeyType  key,
std::string  functionName,
DtKeyState::KeyModifier  modifiers = DtKeyState::NO_MODIFIER,
bool  replace = false,
DtKeyEvent::KeyEventType  eventType = DtKeyEvent::KEY_DOWN 
)

bind a function name to a key/modifier/event type triple

If a function (or functions) are already bound, the new function will be added, unless the replace flag is true

virtual void makVrv::DtKeyMap::removeKeyBinding ( DtKeyState::KeyType  key,
std::string  functionName,
DtKeyState::KeyModifier  modifiers = DtKeyState::NO_MODIFIER,
DtKeyEvent::KeyEventType  eventType = DtKeyEvent::KEY_DOWN 
)
virtual
void makVrv::DtKeyMap::addBinaryKeyBinding ( DtKeyState::KeyType  key,
std::string  binaryName,
DtKeyState::KeyModifier  modifiers = DtKeyState::NO_MODIFIER,
bool  replace = false 
)
virtual void makVrv::DtKeyMap::removeBinaryKeyBinding ( DtKeyState::KeyType  key,
std::string  functionName,
DtKeyState::KeyModifier  modifiers = DtKeyState::NO_MODIFIER 
)
virtual
DtKeyFunctionNameList makVrv::DtKeyMap::getKeyFunctionNameList ( const DtKeyEvent keyEvent)

Return the list of function names associated with this key event.

DtKeyFunctionMapEntry* makVrv::DtKeyMap::findKeyFunctions ( DtKeyState::KeyType  key)

get the map entry for specified key

virtual MappedKeyList makVrv::DtKeyMap::findKeyMappings ( const std::string &  functionName)
virtual

Get a list of the keys (and modifiers) that this function is mapped to in this KeyMap.

virtual MappedKeyList makVrv::DtKeyMap::findBinaryKeyMappings ( const std::string &  functionName)
virtual

Get a list of the keys (and modifiers) that this binary function is mapped to in this KeyMap.

void makVrv::DtKeyMap::getRecord ( makArchives::DtKeyMapRecord record) const

Get a record from this map.

void makVrv::DtKeyMap::setFromRecord ( const makArchives::DtKeyMapRecord record)

Set from a record.

void makVrv::DtKeyMap::buildReverseKeyMap ( )
protected
void makVrv::DtKeyMap::determineParentFunctions ( )
protected

Used by the reverse key map buider, it finds and sets the parent function of key mappings inherited from a parent binary function.

void makVrv::DtKeyMap::processKeyFunctionSet ( const DtKeyFunctionSet functionSet,
DtKeyState::KeyType  keyType,
DtKeyEvent::KeyEventType  eventType 
)
protected
void makVrv::DtKeyMap::processKeyFunctionNameList ( const DtKeyFunctionNameList functionNames,
DtKeyState::KeyType  keyType,
DtKeyEvent::KeyEventType  eventType,
DtKeyState::KeyModifier  modifiers 
)
protected
void makVrv::DtKeyMap::processAddKeyBind ( DtKeyFunctionNameList functionList,
std::string  functionName,
DtKeyState::KeyType  keyType,
DtKeyEvent::KeyEventType  eventType,
DtKeyState::KeyModifier  modifiers,
bool  replace 
)
protected

This binds the function name into the function list for a specific key/modifier/ eventType triple.

It also makes the reverse key map entry for the function name If replace is true, it calls processClearKeyBind() first to clear existing function bindings to this key sequence

void makVrv::DtKeyMap::processRemoveKeyBind ( DtKeyFunctionNameList functionList,
std::string  functionName,
DtKeyState::KeyType  keyType,
DtKeyEvent::KeyEventType  eventType,
DtKeyState::KeyModifier  modifiers 
)
protected
void makVrv::DtKeyMap::processClearKeyBind ( DtKeyFunctionNameList functionList,
DtKeyState::KeyType  keyType,
DtKeyEvent::KeyEventType  eventType,
DtKeyState::KeyModifier  modifiers 
)
protected
void makVrv::DtKeyMap::copyMap ( const KeyMap orig)
protected
void makVrv::DtKeyMap::clearMap ( )
protected

Member Data Documentation

std::string makVrv::DtKeyMap::myName
protected
KeyMap makVrv::DtKeyMap::myKeyMap
protected
DtReverseKeyMap makVrv::DtKeyMap::myReverseKeyMap
protected
DtKeyMapManager& makVrv::DtKeyMap::myKeyMapManager
protected

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

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)