- Timestamp:
- Aug 22, 2005, 12:12:02 AM (19 years ago)
- Location:
- trunk/src/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/shell.cc
r5096 r5097 47 47 this->setBufferDisplaySize(10); 48 48 this->setAbsCoor2D(3, GraphicsEngine::getInstance()->getResolutionY()); 49 this->repeatDelay = .15;50 49 this->delayed = 0; 50 this->setRepeatDelay(.3, .05); 51 51 this->pressedKey = SDLK_FIRST; 52 52 … … 311 311 return false; 312 312 } 313 314 /** 315 * sets the Repeate-delay and rate 316 * @param repeatDelay the Delay it takes, to repeate a key 317 * @param repeatRate the rate to repeate a pressed key 318 */ 319 void Shell::setRepeatDelay(float repeatDelay, float repeatRate) 320 { 321 this->repeatDelay = repeatDelay; 322 this->repeatRate = repeatRate; 323 324 } 325 313 326 314 327 #include "key_names.h" … … 346 359 else if (event.type == SDLK_RETURN) 347 360 this->executeCommand(); 348 else if ( event.type < 127)361 else if (likely(event.type < 127)) 349 362 { 350 363 this->delayed = this->repeatDelay; … … 371 384 else if (this->pressedKey != SDLK_FIRST ) 372 385 { 373 this->delayed = this->repeat Delay;386 this->delayed = this->repeatRate; 374 387 if (this->pressedKey == SDLK_BACKSPACE) 375 388 this->removeCharacters(1); -
trunk/src/util/shell.h
r5096 r5097 54 54 bool executeCommand(); 55 55 56 void setRepeatDelay(float repeatDelay, float repeatRate); 56 57 57 58 // EventListener … … 77 78 Text* inputLineText; //!< The inputLine of the Shell 78 79 char* inputLine; //!< the Char-Array of the Buffer 79 float repeatDelay; //!< The Repeat-Delay. 80 float repeatRate; //!< The Repeat-Delay. 81 float repeatDelay; //!< The delay of the first Character of a given Character. 80 82 float delayed; //!< how much of the delay is remaining. 81 83 int pressedKey; //!< the pressed key that will be repeated.
Note: See TracChangeset
for help on using the changeset viewer.