summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Morph2021-05-18 08:20:05 -0400
committerGravatar Morph2021-05-19 00:26:32 -0400
commit5396593b55946284f3f5d9d776d5417f1ba79151 (patch)
treec2ce04fee5b98a3deb588244f8e27a51e5ebf702
parentMerge pull request #6317 from ameerj/fps-fix (diff)
downloadyuzu-5396593b55946284f3f5d9d776d5417f1ba79151.tar.gz
yuzu-5396593b55946284f3f5d9d776d5417f1ba79151.tar.xz
yuzu-5396593b55946284f3f5d9d776d5417f1ba79151.zip
applets/swkbd: Send the correct text string on TextCheck::Confirm
Previously the text string for the inline software keyboard was being sent instead of the normal software keyboard, leading to empty text being sent all the time.
Diffstat (limited to '')
-rw-r--r--src/yuzu/applets/software_keyboard.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/yuzu/applets/software_keyboard.cpp b/src/yuzu/applets/software_keyboard.cpp
index 653486493..b0f764994 100644
--- a/src/yuzu/applets/software_keyboard.cpp
+++ b/src/yuzu/applets/software_keyboard.cpp
@@ -404,12 +404,16 @@ void QtSoftwareKeyboardDialog::ShowTextCheckDialog(
404 404
405 OverlayDialog dialog(this, system, QString{}, QString::fromStdU16String(text_check_message), 405 OverlayDialog dialog(this, system, QString{}, QString::fromStdU16String(text_check_message),
406 tr("Cancel"), tr("OK"), Qt::AlignCenter); 406 tr("Cancel"), tr("OK"), Qt::AlignCenter);
407 if (dialog.exec() == QDialog::Accepted) { 407 if (dialog.exec() != QDialog::Accepted) {
408 emit SubmitNormalText(SwkbdResult::Ok, current_text); 408 StartInputThread();
409 break; 409 break;
410 } 410 }
411 411
412 StartInputThread(); 412 auto text = ui->topOSK->currentIndex() == 1
413 ? ui->text_edit_osk->toPlainText().toStdU16String()
414 : ui->line_edit_osk->text().toStdU16String();
415
416 emit SubmitNormalText(SwkbdResult::Ok, std::move(text));
413 break; 417 break;
414 } 418 }
415 } 419 }
@@ -480,11 +484,7 @@ void QtSoftwareKeyboardDialog::open() {
480void QtSoftwareKeyboardDialog::reject() { 484void QtSoftwareKeyboardDialog::reject() {
481 // Pressing the ESC key in a dialog calls QDialog::reject(). 485 // Pressing the ESC key in a dialog calls QDialog::reject().
482 // We will override this behavior to the "Cancel" action on the software keyboard. 486 // We will override this behavior to the "Cancel" action on the software keyboard.
483 if (is_inline) { 487 TranslateButtonPress(HIDButton::X);
484 emit SubmitInlineText(SwkbdReplyType::DecidedCancel, current_text, cursor_position);
485 } else {
486 emit SubmitNormalText(SwkbdResult::Cancel, current_text);
487 }
488} 488}
489 489
490void QtSoftwareKeyboardDialog::keyPressEvent(QKeyEvent* event) { 490void QtSoftwareKeyboardDialog::keyPressEvent(QKeyEvent* event) {