Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4400 in orxonox.OLD


Ignore:
Timestamp:
May 30, 2005, 5:55:52 PM (19 years ago)
Author:
patrick
Message:

make

Location:
orxonox/trunk/src/util/event
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/event/key_mapper.cc

    r4399 r4400  
    2222
    2323#include "ini_parser.h"
    24 #include "keynames.h"
     24#include "key_names.h"
    2525
    2626using namespace std;
     
    4242int KeyMapper::PEV_VIEW3 = -1;
    4343int KeyMapper::PEV_VIEW4 = -1;
    44 
     44int KeyMapper::PEV_VIEW5 = -1;
     45
     46
     47orxKeyMapping map[] = { {&KeyMapper::PEV_UP, "Up"},
     48                        {&KeyMapper::PEV_DOWN, "Down"},
     49                        {&KeyMapper::PEV_LEFT, "Left"},
     50                        {&KeyMapper::PEV_RIGHT, "Right"},
     51                        {&KeyMapper::PEV_STRAFE_LEFT, "StrafeLeft"},
     52                        {&KeyMapper::PEV_STRAFE_RIGTH, "StrafeRight"},
     53                       
     54                        {&KeyMapper::PEV_FIRE1, "Fire"},
     55                        {&KeyMapper::PEV_FIRE1, "Fire1"},
     56                        {&KeyMapper::PEV_FIRE2, "Fire2"},
     57
     58                        {&KeyMapper::PEV_VIEW0, "view0"},
     59                        {&KeyMapper::PEV_VIEW1, "view1"},
     60                        {&KeyMapper::PEV_VIEW2, "view2"},
     61                        {&KeyMapper::PEV_VIEW3, "view3"},
     62                        {&KeyMapper::PEV_VIEW4, "view4"},
     63                        {&KeyMapper::PEV_VIEW5, "view5"}
     64                        {NULL, NULL}};
    4565
    4666
     
    150170      memset (valuebuf, 0, 256);
    151171    }
     172  this->mapKeys();
    152173}
    153174
     
    176197void KeyMapper::mapKeys()
    177198{
    178  for(int i = 0; i < N_STD_KEYS; ++i)
    179     {
    180       PRINTF(0)("Button binding array entry %i - %s\n", i, this->keyAliases->keys[i]);
    181     }
     199  for(int i = 0; i < N_STD_KEYS; ++i)
     200    {
     201      if( !strcmp (this->keyAliases->keys[i], "Up")) PEV_UP = i;
     202
     203    }
     204  PRINTF(0)("fire = %i\n", PEV_FIRE1);
    182205}
    183206
  • orxonox/trunk/src/util/event/key_mapper.h

    r4399 r4400  
    2424  char buttons[N_BUTTONS][CMD_LENGHT];
    2525} KeyBindings;
     26
     27typedef struct orxKeyMapping
     28{
     29  int* pValue;
     30  char* name;
     31};
    2632
    2733
     
    5763  static int PEV_VIEW3;
    5864  static int PEV_VIEW4;
     65  static int PEV_VIEW5;
    5966
    6067 private:
     
    6370};
    6471
     72
     73
     74
    6575#endif /* _KEY_MAPPER_H */
Note: See TracChangeset for help on using the changeset viewer.