Changeset 4386 in orxonox.OLD for orxonox/trunk/src/util/event
- Timestamp:
- May 29, 2005, 11:33:49 PM (20 years ago)
- Location:
- orxonox/trunk/src/util/event
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/event/event_handler.cc
r4381 r4386 22 22 #include "event.h" 23 23 24 #include "ini_parser.h"25 #include "keynames.h"26 24 #include "compiler.h" 27 25 #include "debug.h" -
orxonox/trunk/src/util/event/event_handler.h
r4369 r4386 16 16 17 17 18 //! Key aliasing structure 19 /** 20 This structure contains the key aliasing information, e.g. the command strings that 21 have been bound to the keys. 22 */ 23 typedef struct 24 { 25 char keys[N_STD_KEYS][CMD_LENGHT]; 26 char buttons[N_BUTTONS][CMD_LENGHT]; 27 } KeyBindings; 18 28 19 29 20 … … 50 41 private: 51 42 static EventHandler* singletonRef; 52 KeyBindings* keyAliases;53 43 EventListener*** listeners; //!< a list of registered listeners 54 44 elState state; -
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 } -
orxonox/trunk/src/util/event/key_mapper.h
r4368 r4386 11 11 #include "base_object.h" 12 12 #include "event_def.h" 13 14 15 //! Key aliasing structure 16 /** 17 This structure contains the key aliasing information, e.g. the command strings that 18 have been bound to the keys. 19 */ 20 typedef struct 21 { 22 char keys[N_STD_KEYS][CMD_LENGHT]; 23 char buttons[N_BUTTONS][CMD_LENGHT]; 24 } KeyBindings; 13 25 14 26 … … 44 56 private: 45 57 KeyBindings* keyAliases; 58 Sint32 coord[2]; 46 59 }; 47 60
Note: See TracChangeset
for help on using the changeset viewer.