bool GUI_Input::eventKeyDown(const SDL_KeyboardEvent* key){ if(!waiting){ return false; } switch(key->keysym.sym){ case SDLK_ESCAPE: InputEnd(); return false; // forbidden keys case SDLK_F1: case SDLK_F2: case SDLK_F3: case SDLK_F4: return false; default: InputEnd(); SetText(SDL_GetKeyName(key->keysym.sym)); sym=key->keysym.sym; SendMessage(GetParent(), MSG_SIGNAL, id, 0); return true; } }
void InputTextDialog::on_BtnOk_clicked() { emit InputEnd(this->ui->textEdit->toPlainText()); if(!mTextFileName.isEmpty() && this->windowTitle() == TitleOfUnsaved){ on_BtnSave_clicked(); // save to file } }
void GUI_Input::eventInputFocusLost(PG_MessageObject* newfocus){ InputEnd(); }