Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4452 in orxonox.OLD for orxonox/trunk/src/util/event/key_mapper.cc


Ignore:
Timestamp:
Jun 1, 2005, 11:18:44 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: key_mapper.* commented and reviewed

File:
1 edited

Legend:

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

    r4412 r4452  
    2727
    2828
    29 
    30 int KeyMapper::PEV_UP = -1;
    31 int KeyMapper::PEV_DOWN = -1;
    32 int KeyMapper::PEV_LEFT = -1;
    33 int KeyMapper::PEV_RIGHT = -1;
    34 int KeyMapper::PEV_STRAFE_LEFT = -1;
    35 int KeyMapper::PEV_STRAFE_RIGHT = -1;
    36 
    37 int KeyMapper::PEV_FIRE1 = -1;
    38 int KeyMapper::PEV_FIRE2 = -1;
    39 int KeyMapper::PEV_PREVIOUS_WEAPON = -1;
    40 int KeyMapper::PEV_NEXT_WEAPON = -1;
    41 
    42 int KeyMapper::PEV_VIEW0 = -1;
    43 int KeyMapper::PEV_VIEW1 = -1;
    44 int KeyMapper::PEV_VIEW2 = -1;
    45 int KeyMapper::PEV_VIEW3 = -1;
    46 int KeyMapper::PEV_VIEW4 = -1;
    47 int KeyMapper::PEV_VIEW5 = -1;
    48 
    49 int KeyMapper::PEV_NEXT_WORLD = -1;
    50 int KeyMapper::PEV_PREVIOUS_WORLD = -1;
    51 
    52 int KeyMapper::PEV_PAUSE = -1;
    53 int KeyMapper::PEV_QUIT = -1;
    54 
    55 
    56 
    57 
     29/* initialize all variables to a reasonable value*/
     30int KeyMapper::PEV_UP                = EV_UNKNOWN;
     31int KeyMapper::PEV_DOWN              = EV_UNKNOWN;
     32int KeyMapper::PEV_LEFT              = EV_UNKNOWN;
     33int KeyMapper::PEV_RIGHT             = EV_UNKNOWN;
     34int KeyMapper::PEV_STRAFE_LEFT       = EV_UNKNOWN;
     35int KeyMapper::PEV_STRAFE_RIGHT      = EV_UNKNOWN;
     36
     37int KeyMapper::PEV_FIRE1             = EV_UNKNOWN;
     38int KeyMapper::PEV_FIRE2             = EV_UNKNOWN;
     39int KeyMapper::PEV_PREVIOUS_WEAPON   = EV_UNKNOWN;
     40int KeyMapper::PEV_NEXT_WEAPON       = EV_UNKNOWN;
     41
     42int KeyMapper::PEV_VIEW0             = EV_UNKNOWN;
     43int KeyMapper::PEV_VIEW1             = EV_UNKNOWN;
     44int KeyMapper::PEV_VIEW2             = EV_UNKNOWN;
     45int KeyMapper::PEV_VIEW3             = EV_UNKNOWN;
     46int KeyMapper::PEV_VIEW4             = EV_UNKNOWN;
     47int KeyMapper::PEV_VIEW5             = EV_UNKNOWN;
     48
     49int KeyMapper::PEV_NEXT_WORLD        = EV_UNKNOWN;
     50int KeyMapper::PEV_PREVIOUS_WORLD    = EV_UNKNOWN;
     51
     52int KeyMapper::PEV_PAUSE             = EV_UNKNOWN;
     53int KeyMapper::PEV_QUIT              = EV_UNKNOWN;
     54
     55
     56
     57//! this is the mapping array from names to ids: enter all orxonox.conf keys here
    5858orxKeyMapping map[] = { {&KeyMapper::PEV_UP, "Up"},
    5959                        {&KeyMapper::PEV_DOWN, "Down"},
     
    8585
    8686
     87
    8788/**
    8889   \brief standard constructor
    89    \todo this constructor is not jet implemented - do it
    9090*/
    9191KeyMapper::KeyMapper ()
     
    9797/**
    9898   \brief standard deconstructor
    99 
    10099*/
    101100KeyMapper::~KeyMapper ()
    102101{
    103   // delete what has to be deleted here
    104 }
    105 
    106 \
     102}
     103
     104
     105
    107106/**
    108107   \brief loads new key bindings from a file
     
    185184
    186185
    187 
     186/**
     187   \brief this function looks up name to key index
     188   \param the name of the button
     189*/
    188190int* KeyMapper::nameToIndex (char* name)
    189191{
     
    205207
    206208
    207 
     209/**
     210   \brief the function maps name to key ids
     211   \param name of the key
     212   \param id of the key
     213*/
    208214void KeyMapper::mapKeys(char* name, int keyID)
    209215{
     
    216222
    217223
     224/**
     225   \brief this function gives some debug information about the key mapper class
     226*/
    218227void KeyMapper::debug()
    219228{
    220   //PRINT(0)("\n==========================| KeyMapper::debug() |===\n"); 
    221 
     229  PRINT(0)("\n==========================| KeyMapper::debug() |===\n"); 
    222230  for(int i = 0; map[i].pValue != NULL; ++i)
    223231    {
    224232      PRINT(0)("%s = %i\n",map[i].pName, *map[i].pValue);
    225233    }
    226 
    227   //PRINT(0)("=======================================================\n");       
    228 }
     234  PRINT(0)("=======================================================\n");       
     235}
Note: See TracChangeset for help on using the changeset viewer.