Changeset 4452 in orxonox.OLD for orxonox/trunk/src/util/event/key_mapper.cc
- Timestamp:
- Jun 1, 2005, 11:18:44 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/event/key_mapper.cc
r4412 r4452 27 27 28 28 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*/ 30 int KeyMapper::PEV_UP = EV_UNKNOWN; 31 int KeyMapper::PEV_DOWN = EV_UNKNOWN; 32 int KeyMapper::PEV_LEFT = EV_UNKNOWN; 33 int KeyMapper::PEV_RIGHT = EV_UNKNOWN; 34 int KeyMapper::PEV_STRAFE_LEFT = EV_UNKNOWN; 35 int KeyMapper::PEV_STRAFE_RIGHT = EV_UNKNOWN; 36 37 int KeyMapper::PEV_FIRE1 = EV_UNKNOWN; 38 int KeyMapper::PEV_FIRE2 = EV_UNKNOWN; 39 int KeyMapper::PEV_PREVIOUS_WEAPON = EV_UNKNOWN; 40 int KeyMapper::PEV_NEXT_WEAPON = EV_UNKNOWN; 41 42 int KeyMapper::PEV_VIEW0 = EV_UNKNOWN; 43 int KeyMapper::PEV_VIEW1 = EV_UNKNOWN; 44 int KeyMapper::PEV_VIEW2 = EV_UNKNOWN; 45 int KeyMapper::PEV_VIEW3 = EV_UNKNOWN; 46 int KeyMapper::PEV_VIEW4 = EV_UNKNOWN; 47 int KeyMapper::PEV_VIEW5 = EV_UNKNOWN; 48 49 int KeyMapper::PEV_NEXT_WORLD = EV_UNKNOWN; 50 int KeyMapper::PEV_PREVIOUS_WORLD = EV_UNKNOWN; 51 52 int KeyMapper::PEV_PAUSE = EV_UNKNOWN; 53 int KeyMapper::PEV_QUIT = EV_UNKNOWN; 54 55 56 57 //! this is the mapping array from names to ids: enter all orxonox.conf keys here 58 58 orxKeyMapping map[] = { {&KeyMapper::PEV_UP, "Up"}, 59 59 {&KeyMapper::PEV_DOWN, "Down"}, … … 85 85 86 86 87 87 88 /** 88 89 \brief standard constructor 89 \todo this constructor is not jet implemented - do it90 90 */ 91 91 KeyMapper::KeyMapper () … … 97 97 /** 98 98 \brief standard deconstructor 99 100 99 */ 101 100 KeyMapper::~KeyMapper () 102 101 { 103 // delete what has to be deleted here 104 } 105 106 \ 102 } 103 104 105 107 106 /** 108 107 \brief loads new key bindings from a file … … 185 184 186 185 187 186 /** 187 \brief this function looks up name to key index 188 \param the name of the button 189 */ 188 190 int* KeyMapper::nameToIndex (char* name) 189 191 { … … 205 207 206 208 207 209 /** 210 \brief the function maps name to key ids 211 \param name of the key 212 \param id of the key 213 */ 208 214 void KeyMapper::mapKeys(char* name, int keyID) 209 215 { … … 216 222 217 223 224 /** 225 \brief this function gives some debug information about the key mapper class 226 */ 218 227 void KeyMapper::debug() 219 228 { 220 //PRINT(0)("\n==========================| KeyMapper::debug() |===\n"); 221 229 PRINT(0)("\n==========================| KeyMapper::debug() |===\n"); 222 230 for(int i = 0; map[i].pValue != NULL; ++i) 223 231 { 224 232 PRINT(0)("%s = %i\n",map[i].pName, *map[i].pValue); 225 233 } 226 227 //PRINT(0)("=======================================================\n"); 228 } 234 PRINT(0)("=======================================================\n"); 235 }
Note: See TracChangeset
for help on using the changeset viewer.