Changeset 5786 in orxonox.OLD for trunk/src/lib/shell/shell_input.cc
- Timestamp:
- Nov 26, 2005, 9:56:11 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_input.cc
r5785 r5786 317 317 { 318 318 this->delayed = this->repeatRate; 319 if (this->pressedKey == SDLK_BACKSPACE) 320 this->removeCharacters(1); 321 else if (pressedKey < 127) 322 this->addCharacter(this->pressedKey); 319 switch (this->pressedKey ) 320 { 321 case SDLK_BACKSPACE: 322 this->removeCharacters(1); 323 break; 324 case SDLK_UP: 325 this->historyMoveUp(); 326 break; 327 case SDLK_DOWN: 328 this->historyMoveDown(); 329 break; 330 default: 331 { 332 if (likely(pressedKey < 127)) 333 this->addCharacter(this->pressedKey); 334 } 335 } 323 336 } 324 337 } … … 336 349 this->help(); 337 350 else if (event.type == SDLK_F2) 351 { 338 352 ;//this->debug(); 353 } 339 354 else if (event.type == SDLK_UP) 355 { 340 356 this->historyMoveUp(); 357 this->pressedKey = event.type; 358 } 341 359 else if (event.type == SDLK_DOWN) 360 { 342 361 this->historyMoveDown(); 362 this->pressedKey = event.type; 363 } 343 364 else if (event.type == SDLK_TAB) 344 365 this->completion->autoComplete(); … … 350 371 } 351 372 else if (event.type == SDLK_RETURN) 373 { 352 374 this->executeCommand(); 375 this->pressedKey = event.type; 376 } 353 377 // any other keyboard key 354 378 else if (likely(event.type < 127)) 355 379 { 356 Uint8 *keystate = SDL_GetKeyState(NULL); 357 this->delayed = this->repeatDelay; 358 if (unlikely( keystate[SDLK_LSHIFT] || keystate[SDLK_RSHIFT] )) 359 { 360 this->pressedKey = event.type-32; 361 this->addCharacter(event.type-32); 362 } 363 else 364 { 365 this->pressedKey = event.type; 366 this->addCharacter(event.type); 367 } 368 } 380 this->addCharacter(event.x); 381 this->pressedKey = event.x; 382 } 383 this->delayed = this->repeatDelay; 369 384 } 370 385 else // if(!event.bPressed) 371 386 { 372 if (this->pressedKey == event. type || (this->pressedKey == event.type - 32))373 { 374 this->pressedKey = SDLK_FIRST;387 if (this->pressedKey == event.x) 388 { 389 this->pressedKey = 0; 375 390 this->delayed = 0.0; 376 391 }
Note: See TracChangeset
for help on using the changeset viewer.