Changeset 4400 in orxonox.OLD for orxonox/trunk/src/util/event
- Timestamp:
- May 30, 2005, 5:55:52 PM (20 years ago)
- Location:
- orxonox/trunk/src/util/event
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/event/key_mapper.cc
r4399 r4400 22 22 23 23 #include "ini_parser.h" 24 #include "key names.h"24 #include "key_names.h" 25 25 26 26 using namespace std; … … 42 42 int KeyMapper::PEV_VIEW3 = -1; 43 43 int KeyMapper::PEV_VIEW4 = -1; 44 44 int KeyMapper::PEV_VIEW5 = -1; 45 46 47 orxKeyMapping 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}}; 45 65 46 66 … … 150 170 memset (valuebuf, 0, 256); 151 171 } 172 this->mapKeys(); 152 173 } 153 174 … … 176 197 void KeyMapper::mapKeys() 177 198 { 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); 182 205 } 183 206 -
orxonox/trunk/src/util/event/key_mapper.h
r4399 r4400 24 24 char buttons[N_BUTTONS][CMD_LENGHT]; 25 25 } KeyBindings; 26 27 typedef struct orxKeyMapping 28 { 29 int* pValue; 30 char* name; 31 }; 26 32 27 33 … … 57 63 static int PEV_VIEW3; 58 64 static int PEV_VIEW4; 65 static int PEV_VIEW5; 59 66 60 67 private: … … 63 70 }; 64 71 72 73 74 65 75 #endif /* _KEY_MAPPER_H */
Note: See TracChangeset
for help on using the changeset viewer.