Changeset 4386 in orxonox.OLD for orxonox/trunk/src/util/event/key_mapper.cc
- Timestamp:
- May 29, 2005, 11:33:49 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/event/key_mapper.cc
r4369 r4386 16 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_EVENT 17 17 18 #include "event.h" 18 #include "key_mapper.h" 19 20 #include "ini_parser.h" 21 #include "keynames.h" 19 22 20 23 using namespace std; 24 25 26 27 int KeyMapper::PEV_UP = -1; 28 int KeyMapper::PEV_DOWN = -1; 29 int KeyMapper::PEV_LEFT = -1; 30 int KeyMapper::PEV_RIGHT = -1; 31 int KeyMapper::PEV_STRAFE_LEFT = -1; 32 int KeyMapper::PEV_STRAFE_RIGHT = -1; 33 34 int KeyMapper::PEV_FIRE1 = -1; 35 int KeyMapper::PEV_FIRE2 = -1; 36 37 int KeyMapper::PEV_VIEW1 = -1; 38 int KeyMapper::PEV_VIEW2 = -1; 39 int KeyMapper::PEV_VIEW3 = -1; 40 int KeyMapper::PEV_VIEW4 = -1; 41 21 42 22 43 … … 28 49 { 29 50 this->setClassID(CL_KEY_MAPPER, "KeyMapper"); 30 51 this->keyAliases = NULL; 31 52 } 32 53 … … 41 62 } 42 63 43 64 \ 44 65 /** 45 66 \brief loads new key bindings from a file … … 115 136 while( parser.nextVar (namebuf, valuebuf) != -1) 116 137 { 117 //index = nameToIndex (valuebuf); 118 int c; 119 if( (c = keynameToSDLK (valuebuf)) != -1) 120 { 121 index[1] = c; index[0] = 0; 122 } 123 if( (c = buttonnameToSDLB (valuebuf)) != -1) 124 { 125 index[1] = c; index[0] = 1; 126 } 127 138 index = nameToIndex (valuebuf); 128 139 129 140 switch( index[0]) … … 144 155 } 145 156 } 157 158 159 160 int* KeyMapper::nameToIndex (char* name) 161 { 162 coord[0] = -1; 163 coord[1] = -1; 164 int c; 165 if( (c = keynameToSDLK (name)) != -1) 166 { 167 coord[1] = c; 168 coord[0] = 0; 169 } 170 if( (c = buttonnameToSDLB (name)) != -1) 171 { 172 coord[1] = c; 173 coord[0] = 1; 174 } 175 return coord; 176 }
Note: See TracChangeset
for help on using the changeset viewer.