Changeset 5096 in orxonox.OLD for trunk/src/util
- Timestamp:
- Aug 22, 2005, 12:01:04 AM (19 years ago)
- Location:
- trunk/src/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/shell.cc
r5095 r5096 60 60 61 61 EventHandler* evh = EventHandler::getInstance(); 62 evh->subscribe(this, ES_ GAME, SDLK_BACKQUOTE);62 evh->subscribe(this, ES_ALL, SDLK_BACKQUOTE); 63 63 for (int i = 1; i < SDLK_F15; i++) 64 64 evh->subscribe(this, ES_SHELL, i); … … 295 295 this->inputLine = removeCharLine; 296 296 this->inputLineText->setText(inputLine); 297 } 298 299 /** 300 * executes the command stored in the inputLine 301 * @return true if the command was commited successfully, false otherwise 302 */ 303 bool Shell::executeCommand() 304 { 305 306 this->addBufferLineStatic("Execute Command: %s\n", this->inputLine); 307 delete this->inputLine; 308 this->inputLine = new char[1]; 309 this->inputLine[0]='\0'; 310 this->inputLineText->setText(this->inputLine); 311 return false; 297 312 } 298 313 … … 329 344 this->removeCharacters(1); 330 345 } 346 else if (event.type == SDLK_RETURN) 347 this->executeCommand(); 331 348 else if (event.type < 127) 332 349 { … … 384 401 void Shell::debug() const 385 402 { 386 387 } 403 if (this->pressedKey != SDLK_FIRST) 404 printf("%s::%f %f\n", SDLKToKeyname(this->pressedKey), this->delayed, this->repeatDelay); 405 406 } -
trunk/src/util/shell.h
r5095 r5096 52 52 void addCharacters(const char* characters); 53 53 void removeCharacters(unsigned int characterCount = 1); 54 bool executeCommand(); 54 55 55 56
Note: See TracChangeset
for help on using the changeset viewer.