Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7661 in orxonox.OLD for trunk/src/lib/event/key_mapper.h


Ignore:
Timestamp:
May 18, 2006, 12:55:34 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the QT_GUI back to the trunk
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/qt_gui . -r7607:HEAD

absolutely no conflicts :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/event/key_mapper.h

    r7256 r7661  
    1010
    1111#include "base_object.h"
    12 //#include "event_def.h"
    13 
     12#include <string>
    1413class IniParser;
    1514
    16 //! A mapping from key-name to key-id
    17 typedef struct orxKeyMapping
     15//! The map class functionalities
     16class KeyMapper : public BaseObject
    1817{
    19   int* pValue;
    20   char* pName;
    21 };
     18public:
     19  //! A mapping from key-name to key-id
     20  typedef struct KeyMapping
     21  {
     22    int*              pValue;
     23    const std::string pName;
     24    int               defaultValue;
     25  };
    2226
    23 
    24 //! The map class functionalities
    25 class KeyMapper : public BaseObject {
    26 
    27  public:
     27public:
    2828  KeyMapper();
    2929  virtual ~KeyMapper();
     
    3333  void loadKeyBindings(IniParser* iniParser);
    3434
     35  static const KeyMapping* getKeyMapping() { return KeyMapper::map; };
     36
    3537  void debug();
    3638
    37  private:
     39private:
    3840  int* nameToIndex (const std::string& name);
    3941  void mapKeys(const std::string& name, int* index);
    4042
    41  public:
     43public:
    4244  static int PEV_FORWARD;           //!< forward button
    4345  static int PEV_BACKWARD;          //!< backward buttton
     
    7375  static int PEV_QUIT;              //!< quit button
    7476
    75  private:
    76   int         coord[2];              //!< temp place to save variables in nameToIndex() function
     77private:
     78  int                coord[2];      //!< temp place to save variables in nameToIndex() function
     79  static KeyMapping  map[];         //!< The KeyMapping that maps strings to ID's and Vice Versa
    7780};
    7881
Note: See TracChangeset for help on using the changeset viewer.