Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

CKeyMap Class Reference

#include <KeyMap.h>

Inheritance diagram for CKeyMap:

CStreamObject CObject List of all members.

Public Member Functions

 CKeyMap (const char *keyFilename)
 ~CKeyMap (void)
virtual int Read (SStream *stream, Tag tag)
void Print (FILE *f)
void KeyPress (EKeyboardKeys key, EKeyboardModifiers mod)
void Bind (Tag id, KeyCallbackPtr f)
int GetNumKeySets (void)
CKeySetGetKeySet (int i)

Protected Attributes

int vers
std::map< Tag, CKeySet * > kset

Private Member Functions

CKeyDefinitionFindKeyDefinitionById (Tag id)

Detailed Description

Definition at line 105 of file KeyMap.h.


Constructor & Destructor Documentation

CKeyMap::CKeyMap const char *  keyFilename  ) 
 

Definition at line 223 of file KeyMap.cpp.

References CloseStream(), SStream::filename, gtfo, SStream::mode, OpenStream(), ReadFrom(), and SStream::stream.

CKeyMap::~CKeyMap void   ) 
 

Definition at line 239 of file KeyMap.cpp.

References kset.


Member Function Documentation

void CKeyMap::Bind Tag  id,
KeyCallbackPtr  f
 

Definition at line 468 of file KeyMap.cpp.

References CKeyDefinition::cb, and FindKeyDefinitionById().

Referenced by BindAirplaneKeys(), BindCameraKeys(), BindGlobalKeys(), BindMenuKeys(), and BindSlewKeys().

CKeyDefinition * CKeyMap::FindKeyDefinitionById Tag  id  )  [private]
 

Todo:
Create master index of valid key IDs to avoid linear search of keysets

Definition at line 447 of file KeyMap.cpp.

References CKeySet::kkey, and kset.

Referenced by Bind().

CKeySet * CKeyMap::GetKeySet int  i  ) 
 

Definition at line 509 of file KeyMap.cpp.

References GetNumKeySets(), and kset.

Referenced by keys_buttons_dlg_create(), and keys_buttons_keyset_cb().

int CKeyMap::GetNumKeySets void   ) 
 

Definition at line 503 of file KeyMap.cpp.

References kset.

Referenced by GetKeySet(), and keys_buttons_dlg_create().

void CKeyMap::KeyPress EKeyboardKeys  key,
EKeyboardModifiers  mod
 

Todo:
Create map of keycode to key definition vector

Definition at line 475 of file KeyMap.cpp.

References CKeyDefinition::cb, CKeyDefinition::code, CKeySet::kkey, kset, and CKeyDefinition::kyid.

Referenced by idle(), keyboard(), and special().

void CKeyMap::Print FILE *  f  ) 
 

Definition at line 416 of file KeyMap.cpp.

References CKeyDefinition::code, formatKeyCode(), CKeySet::kkey, CKeySet::kset, kset, CKeyDefinition::kyid, CKeyDefinition::name, CKeySet::name, and TagToString().

Referenced by debug_dump_keymap_cb().

int CKeyMap::Read SStream stream,
Tag  tag
[virtual]
 

Reimplemented from CStreamObject.

Definition at line 248 of file KeyMap.cpp.

References globals, CKeySet::kset, kset, SGlobals::logWarning, ReadFrom(), ReadInt(), ReadTag(), TAG_IGNORED, TAG_READ, TagToString(), vers, and CLogFile::Write().


Member Data Documentation

std::map<Tag,CKeySet*> CKeyMap::kset [protected]
 

Definition at line 125 of file KeyMap.h.

Referenced by FindKeyDefinitionById(), GetKeySet(), GetNumKeySets(), KeyPress(), Print(), Read(), and ~CKeyMap().

int CKeyMap::vers [protected]
 

Definition at line 124 of file KeyMap.h.

Referenced by Read().


The documentation for this class was generated from the following files:
SourceForge.net Logo Documentation generated by doxygen