int deletePreviousWordFromCurs(wchar_t * CommandLine, unsigned int *cursorLocation) { /* Delete void character before cursor */ while (*cursorLocation && (CommandLine[*cursorLocation - 1] == ' ' || CommandLine[*cursorLocation - 1] == '\t')) { rmChar(CommandLine, SCI_BACKSPACE, cursorLocation); } /* Then delete word before cursor */ while (*cursorLocation && CommandLine[*cursorLocation - 1] != ' ' && CommandLine[*cursorLocation - 1] != '\t') { rmChar(CommandLine, SCI_BACKSPACE, cursorLocation); } return 0; }
int deleteFromCursToBeginningLine(wchar_t * CommandLine, unsigned int *cursorLocation) { while (*cursorLocation) { rmChar(CommandLine, SCI_BACKSPACE, cursorLocation); } return 0; }
void TiBasicEditor::sendKey(SDL_keysym k1) { SDLKey k=k1.sym; if (keyParser::isChar(k1)) { sendChar(keyParser::getChar(k1)); return; } if (_isInSpecialCommandsMenu) { switch (k) { case SDLK_RETURN: sendChar( _specialsCommandsMenu->getSelectedString()[0]); _isInSpecialCommandsMenu=false; reDisplay(); return; case SDLK_DELETE: _isInSpecialCommandsMenu=false; reDisplay(); return; default: _specialsCommandsMenu->sendKey(k1); } } else { switch (k) { case SDLK_DELETE: rmChar(); break; case SDLK_UP: changeLine(true); break; case SDLK_DOWN: changeLine(false); break; case SDLK_LEFT: changeCursorPos(true); break; case SDLK_RIGHT: changeCursorPos(false); break; case SDLK_RETURN: addLine(); break; case SDLK_LALT: _isInSpecialCommandsMenu=true; _specialsCommandsMenu->reDisplay(); break; } } }