Changeset 5986 for code/branches/console
- Timestamp:
- Oct 22, 2009, 11:32:30 PM (15 years ago)
- Location:
- code/branches/console/src/libraries/core
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/console/src/libraries/core/IOConsole.cc
r5985 r5986 127 127 this->buffer_->buttonPressed(KeyEvent(KeyCode::End, 0, 0)); 128 128 else if (this->escapeSequence_ == "5~") 129 this->buffer_->buttonPressed(KeyEvent(KeyCode:: PageUp, 0, 0));129 this->buffer_->buttonPressed(KeyEvent(KeyCode::AltPageUp, 0, 0)); 130 130 else if (this->escapeSequence_ == "6~") 131 this->buffer_->buttonPressed(KeyEvent(KeyCode:: PageDown, 0, 0));131 this->buffer_->buttonPressed(KeyEvent(KeyCode::AltPageDown, 0, 0)); 132 132 else if (this->escapeSequence_.size() > 4) 133 133 // User probably very quickly pressed ESC and [ -
code/branches/console/src/libraries/core/Shell.cc
r5983 r5986 30 30 31 31 #include "util/OutputHandler.h" 32 #include "util/StringUtils.h" 32 33 #include "CommandExecutor.h" 33 34 #include "CoreIncludes.h" … … 132 133 this->inputBuffer_->registerListener(this, &Shell::scroll_up, KeyCode::PageUp); 133 134 this->inputBuffer_->registerListener(this, &Shell::scroll_down, KeyCode::PageDown); 135 this->inputBuffer_->registerListener(this, &Shell::history_search_up, KeyCode::AltPageUp); 136 this->inputBuffer_->registerListener(this, &Shell::history_search_down, KeyCode::AltPageDown); 134 137 } 135 138 … … 357 360 } 358 361 362 void Shell::history_search_up() 363 { 364 if (this->historyPosition_ == this->historyOffset_) 365 return; 366 unsigned int cursorPosition = this->getCursorPosition(); 367 std::string input_str( this->getInput().substr(0,cursorPosition) ); //only search for the expression from the beginning of the inputline untill the cursor position 368 for (unsigned int newPos = this->historyPosition_+1; newPos<=this->historyOffset_; newPos++) 369 { 370 if (getLowercase(this->commandHistory_[this->historyOffset_ - newPos]).find(getLowercase(input_str)) == 0) //search case insensitive 371 { 372 this->historyPosition_ = newPos; 373 this->inputBuffer_->set(this->getFromHistory()); 374 this->setCursorPosition( cursorPosition ); 375 return; 376 } 377 } 378 } 379 380 void Shell::history_search_down() 381 { 382 if (this->historyPosition_ == 0) 383 return; 384 unsigned int cursorPosition = this->getCursorPosition(); 385 std::string input_str( this->getInput().substr(0,cursorPosition) ); //only search for the expression from the beginn$ 386 for (unsigned int newPos = this->historyPosition_-1; newPos>0; newPos--) 387 { 388 if (getLowercase(this->commandHistory_[this->historyOffset_ - newPos]).find(getLowercase(input_str)) == 0) //sear$ 389 { 390 this->historyPosition_ = newPos; 391 this->inputBuffer_->set(this->getFromHistory()); 392 this->setCursorPosition( cursorPosition ); 393 return; 394 } 395 } 396 } 397 359 398 void Shell::scroll_up() 360 399 { -
code/branches/console/src/libraries/core/Shell.h
r5983 r5986 129 129 void history_up(); 130 130 void history_down(); 131 void history_search_up(); 132 void history_search_down(); 131 133 void scroll_up(); 132 134 void scroll_down(); -
code/branches/console/src/libraries/core/input/InputPrereqs.h
r5781 r5986 179 179 Up = OIS::KC_UP, // UpArrow on arrow keypad 180 180 PageUp = OIS::KC_PGUP, // PgUp on arrow keypad 181 AltPageUp = OIS::KC_PGUP+1, // Alternative PgUp for the IOConsole 181 182 Left = OIS::KC_LEFT, // LeftArrow on arrow keypad 182 183 Right = OIS::KC_RIGHT, // RightArrow on arrow keypad … … 184 185 Down = OIS::KC_DOWN, // DownArrow on arrow keypad 185 186 PageDown = OIS::KC_PGDOWN, // PgDn on arrow keypad 187 AltPageDown = OIS::KC_END-1, // Alternative PgUp for IOConsole 186 188 Insert = OIS::KC_INSERT, // Insert on arrow keypad 187 189 Delete = OIS::KC_DELETE, // Delete on arrow keypad … … 286 288 "UP", 287 289 "PageUp", 288 "", 290 "", // used for AltPageUp 289 291 "Left", 290 292 "", 291 293 "Right", 292 "", 294 "", // used for AltPageDown 293 295 "End", "Down", "PageDown", "Insert", "Delete", 294 296 "","","","","","","",
Note: See TracChangeset
for help on using the changeset viewer.