Changeset 4364 in orxonox.OLD for orxonox/trunk/src/util/event
- Timestamp:
- May 28, 2005, 3:14:43 PM (20 years ago)
- Location:
- orxonox/trunk/src/util/event
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/event/event_def.h
r4363 r4364 11 11 12 12 #define CMD_LENGHT 16 13 #define N_STD_KEYS SDLK_LAST 14 #define N_BUTTONS 6 15 #define DEFAULT_KEYBIND_FILE "~/.orxonox/orxonox.conf" 16 13 17 14 18 typedef enum extEventTyes … … 22 26 }; 23 27 28 typedef enum elState 29 { 30 ES_GAME, 31 ES_GAME_MENU, 32 ES_MENU, 33 34 ES_ALL, 35 36 ES_NUMBER, 37 }; 38 24 39 25 40 #endif /* _EVENT_DEF_H */ -
orxonox/trunk/src/util/event/event_handler.cc
r4363 r4364 198 198 } 199 199 200 void EventHandler::flush() 201 { 202 for(int i = 0; i < ES_NUMBER; ++i) 200 void EventHandler::flush(elState state) 201 { 202 if( state == ES_ALL) 203 { 204 for(int i = 0; i < ES_NUMBER; ++i) 205 { 206 for(int j = 0; j < SDLK_LAST; ++j) 207 { 208 this->listeners[i][j] = NULL; 209 } 210 } 211 } 212 else 203 213 { 204 214 for(int j = 0; j < SDLK_LAST; ++j) 205 215 { 206 this->listeners[ i][j] = NULL;216 this->listeners[state][j] = NULL; 207 217 } 208 218 } … … 214 224 { 215 225 SDL_Event event; 216 //Command cmd;217 226 Event ev; 218 227 EventListener* listener; … … 270 279 } 271 280 281 /* small debug routine: shows alle events dispatched by the event handler */ 282 PRINT(0)("\n==========================| EventHandler::Process () |===\n"); 283 PRINT(0)("= Got Event nr%i\n, for state %i", event.type, this->state); 284 PRINT(0)("=======================================================\n"); 285 272 286 listener = this->listeners[this->state][event.key.keysym.sym]; 273 287 //if( listener != NULL) -
orxonox/trunk/src/util/event/event_handler.h
r4362 r4364 15 15 16 16 17 #define N_STD_KEYS SDLK_LAST18 #define N_BUTTONS 619 #define DEFAULT_KEYBIND_FILE "~/.orxonox/orxonox.conf"20 21 typedef enum elState22 {23 ES_GAME,24 ES_GAME_MENU,25 ES_MENU,26 27 ES_ALL,28 29 ES_NUMBER,30 };31 17 32 18 //! Key aliasing structure … … 53 39 void subscribeListener(EventListener* el, elState state, int eventType); 54 40 void unsubscribeListener(int eventType, elState state); 55 void flush( );41 void flush(elState state); 56 42 57 43 void loadKeyBindings(const char* fileName);
Note: See TracChangeset
for help on using the changeset viewer.