KeyboardKey Class Reference

#include <KeyboardKey.h>

List of all members.

Public Member Functions

 KeyboardKey (const char *name, const char *title, const char *description, int group, bool command)
virtual ~KeyboardKey ()
bool keyDown (char *buffer, unsigned int keyState, bool repeat=true)
bool keyMatch (unsigned key)
bool addKeys (std::list< std::string > &keyNames, std::list< std::string > &keyStates)
void addKey (unsigned int position, unsigned int key, unsigned int state)
void removeKey (unsigned int position)
int keyIndex (unsigned int key, unsigned int state)
std::vector< KeyEntry > & getKeys ()
const char * getName ()
const char * getTitle ()
const char * getDescription ()
int getGroup ()
bool getNameIsCommand ()
bool getChanged ()
void setChanged (bool changed)

Static Public Member Functions

static bool translateKeyName (const char *name, unsigned int &key)
static bool translateKeyState (const char *name, unsigned int &state)
static bool translateKeyNameValue (unsigned int key, const char *&name)
static bool translateKeyStateValue (unsigned int state, const char *&name)

Protected Attributes

std::string name_
std::string title_
std::string description_
std::vector< KeyEntrykeys_
int group_
bool keyToogle_
bool command_
bool changed_

Private Member Functions

 KeyboardKey (const KeyboardKey &)
const KeyboardKeyoperator= (const KeyboardKey &)

Classes

struct  KeyEntry


Detailed Description

Definition at line 28 of file KeyboardKey.h.


Constructor & Destructor Documentation

KeyboardKey::KeyboardKey ( const char *  name,
const char *  title,
const char *  description,
int  group,
bool  command 
)

Definition at line 26 of file KeyboardKey.cpp.

KeyboardKey::~KeyboardKey (  )  [virtual]

Definition at line 37 of file KeyboardKey.cpp.

KeyboardKey::KeyboardKey ( const KeyboardKey  )  [private]


Member Function Documentation

bool KeyboardKey::keyDown ( char *  buffer,
unsigned int  keyState,
bool  repeat = true 
)

Definition at line 184 of file KeyboardKey.cpp.

References keys_, and keyToogle_.

Referenced by GLWWindowManager::keyboardCheck(), ConsoleImpl::keyboardCheck(), GLWChannelView::keyDown(), and TankKeyboardControlUtil::moveUpDown().

bool KeyboardKey::keyMatch ( unsigned  key  ) 

Definition at line 201 of file KeyboardKey.cpp.

References keys_.

bool KeyboardKey::addKeys ( std::list< std::string > &  keyNames,
std::list< std::string > &  keyStates 
)

Definition at line 41 of file KeyboardKey.cpp.

References addKey(), DIALOG_ASSERT, S3D::dialogMessage(), S3D::formatStringBuffer(), keys_, name_, translateKeyName(), and translateKeyState().

Referenced by Keyboard::loadKeyFile().

void KeyboardKey::addKey ( unsigned int  position,
unsigned int  key,
unsigned int  state 
)

Definition at line 96 of file KeyboardKey.cpp.

References changed_, KeyboardKey::KeyEntry::key, keys_, and KeyboardKey::KeyEntry::state.

Referenced by addKeys(), and DisplayFrame::onKeyButton().

void KeyboardKey::removeKey ( unsigned int  position  ) 

Definition at line 114 of file KeyboardKey.cpp.

References changed_, and keys_.

Referenced by Keyboard::loadKeyFile(), and DisplayFrame::onKeyButton().

int KeyboardKey::keyIndex ( unsigned int  key,
unsigned int  state 
)

Definition at line 81 of file KeyboardKey.cpp.

References KeyboardKey::KeyEntry::key, keys_, and KeyboardKey::KeyEntry::state.

Referenced by Keyboard::loadKeyFile().

std::vector<KeyEntry>& KeyboardKey::getKeys (  )  [inline]

Definition at line 54 of file KeyboardKey.h.

References keys_.

Referenced by Keyboard::loadKeyFile(), DisplayFrame::onKeyButton(), GLWChannelText::processNotVisibleKey(), DisplayFrame::refreshKeysControls(), and Keyboard::saveKeyFile().

const char* KeyboardKey::getName (  )  [inline]

Definition at line 55 of file KeyboardKey.h.

References name_.

Referenced by createKeysControls(), ConsoleImpl::keyboardCheck(), Keyboard::loadKeyFile(), and Keyboard::saveKeyFile().

const char* KeyboardKey::getTitle (  )  [inline]

Definition at line 56 of file KeyboardKey.h.

References title_.

Referenced by createKeysControls(), and Keyboard::saveKeyFile().

const char* KeyboardKey::getDescription (  )  [inline]

Definition at line 57 of file KeyboardKey.h.

References description_.

Referenced by createKeysControls(), and Keyboard::saveKeyFile().

int KeyboardKey::getGroup (  )  [inline]

Definition at line 58 of file KeyboardKey.h.

References group_.

Referenced by createKeysControls(), and Keyboard::saveKeyFile().

bool KeyboardKey::getNameIsCommand (  )  [inline]

Definition at line 59 of file KeyboardKey.h.

References command_.

Referenced by Keyboard::loadKeyFile(), and Keyboard::saveKeyFile().

bool KeyboardKey::getChanged (  )  [inline]

Definition at line 60 of file KeyboardKey.h.

References changed_.

Referenced by Keyboard::saveKeyFile().

void KeyboardKey::setChanged ( bool  changed  )  [inline]

Definition at line 61 of file KeyboardKey.h.

References changed_.

Referenced by Keyboard::loadKeyFile().

bool KeyboardKey::translateKeyName ( const char *  name,
unsigned int &  key 
) [static]

Definition at line 134 of file KeyboardKey.cpp.

References KeyTranslation::keySym, KeyTranslationTable, and LangStringUtil::strcmp().

Referenced by addKeys().

bool KeyboardKey::translateKeyState ( const char *  name,
unsigned int &  state 
) [static]

Definition at line 147 of file KeyboardKey.cpp.

References KeyStateTranslation::keyStateSym, KeyStateTranslationTable, and LangStringUtil::strcmp().

Referenced by addKeys().

bool KeyboardKey::translateKeyNameValue ( unsigned int  key,
const char *&  name 
) [static]

Definition at line 160 of file KeyboardKey.cpp.

References KeyTranslation::keyName, and KeyTranslationTable.

Referenced by Keyboard::loadKeyFile(), DisplayFrame::refreshKeysControls(), and Keyboard::saveKeyFile().

bool KeyboardKey::translateKeyStateValue ( unsigned int  state,
const char *&  name 
) [static]

Definition at line 172 of file KeyboardKey.cpp.

References KeyStateTranslation::keyStateName, and KeyStateTranslationTable.

Referenced by Keyboard::loadKeyFile(), DisplayFrame::refreshKeysControls(), and Keyboard::saveKeyFile().

const KeyboardKey& KeyboardKey::operator= ( const KeyboardKey  )  [private]


Member Data Documentation

std::string KeyboardKey::name_ [protected]

Definition at line 69 of file KeyboardKey.h.

Referenced by addKeys(), and getName().

std::string KeyboardKey::title_ [protected]

Definition at line 70 of file KeyboardKey.h.

Referenced by getTitle().

std::string KeyboardKey::description_ [protected]

Definition at line 71 of file KeyboardKey.h.

Referenced by getDescription().

std::vector<KeyEntry> KeyboardKey::keys_ [protected]

Definition at line 72 of file KeyboardKey.h.

Referenced by addKey(), addKeys(), getKeys(), keyDown(), keyIndex(), keyMatch(), and removeKey().

int KeyboardKey::group_ [protected]

Definition at line 73 of file KeyboardKey.h.

Referenced by getGroup().

bool KeyboardKey::keyToogle_ [protected]

Definition at line 74 of file KeyboardKey.h.

Referenced by keyDown().

bool KeyboardKey::command_ [protected]

Definition at line 75 of file KeyboardKey.h.

Referenced by getNameIsCommand().

bool KeyboardKey::changed_ [protected]

Definition at line 76 of file KeyboardKey.h.

Referenced by addKey(), getChanged(), removeKey(), and setChanged().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:03 2009 for Scorched3D by  doxygen 1.5.3