From d701e13d493fcb0b0c5233a8a5c08bbae6243fa5 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Mon, 8 Nov 2021 20:53:36 +0100 Subject: [PATCH] early-access version 2191 --- README.md | 2 +- .../frontend/applets/software_keyboard.cpp | 5 +++-- src/core/frontend/applets/software_keyboard.h | 6 +++--- .../am/applets/applet_software_keyboard.cpp | 20 ++++++++++++------- .../am/applets/applet_software_keyboard.h | 3 ++- src/yuzu/applets/qt_software_keyboard.cpp | 9 +++++---- src/yuzu/applets/qt_software_keyboard.h | 12 +++++------ .../configuration/configure_input_player.cpp | 1 + src/yuzu/main.cpp | 5 +++-- src/yuzu/main.h | 2 +- 10 files changed, 38 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 9e9acd3f6..8926d5077 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 2189. +This is the source code for early-access 2191. ## Legal Notice diff --git a/src/core/frontend/applets/software_keyboard.cpp b/src/core/frontend/applets/software_keyboard.cpp index 12c76c9ee..c4863ee73 100755 --- a/src/core/frontend/applets/software_keyboard.cpp +++ b/src/core/frontend/applets/software_keyboard.cpp @@ -16,7 +16,8 @@ DefaultSoftwareKeyboardApplet::~DefaultSoftwareKeyboardApplet() = default; void DefaultSoftwareKeyboardApplet::InitializeKeyboard( bool is_inline, KeyboardInitializeParameters initialize_parameters, - std::function submit_normal_callback_, + std::function + submit_normal_callback_, std::function submit_inline_callback_) { if (is_inline) { @@ -128,7 +129,7 @@ void DefaultSoftwareKeyboardApplet::ExitKeyboard() const { } void DefaultSoftwareKeyboardApplet::SubmitNormalText(std::u16string text) const { - submit_normal_callback(Service::AM::Applets::SwkbdResult::Ok, text); + submit_normal_callback(Service::AM::Applets::SwkbdResult::Ok, text, true); } void DefaultSoftwareKeyboardApplet::SubmitInlineText(std::u16string_view text) const { diff --git a/src/core/frontend/applets/software_keyboard.h b/src/core/frontend/applets/software_keyboard.h index 29109306b..490c55cc2 100755 --- a/src/core/frontend/applets/software_keyboard.h +++ b/src/core/frontend/applets/software_keyboard.h @@ -57,7 +57,7 @@ public: virtual void InitializeKeyboard( bool is_inline, KeyboardInitializeParameters initialize_parameters, - std::function + std::function submit_normal_callback_, std::function submit_inline_callback_) = 0; @@ -82,7 +82,7 @@ public: void InitializeKeyboard( bool is_inline, KeyboardInitializeParameters initialize_parameters, - std::function + std::function submit_normal_callback_, std::function submit_inline_callback_) override; @@ -106,7 +106,7 @@ private: KeyboardInitializeParameters parameters; - mutable std::function + mutable std::function submit_normal_callback; mutable std::function submit_inline_callback; diff --git a/src/core/hle/service/am/applets/applet_software_keyboard.cpp b/src/core/hle/service/am/applets/applet_software_keyboard.cpp index c89aa1bbf..1f21cee91 100755 --- a/src/core/hle/service/am/applets/applet_software_keyboard.cpp +++ b/src/core/hle/service/am/applets/applet_software_keyboard.cpp @@ -109,13 +109,18 @@ void SoftwareKeyboard::Execute() { ShowNormalKeyboard(); } -void SoftwareKeyboard::SubmitTextNormal(SwkbdResult result, std::u16string submitted_text) { +void SoftwareKeyboard::SubmitTextNormal(SwkbdResult result, std::u16string submitted_text, + bool confirmed) { if (complete) { return; } if (swkbd_config_common.use_text_check && result == SwkbdResult::Ok) { - SubmitForTextCheck(submitted_text); + if (confirmed) { + SubmitNormalOutputAndExit(result, submitted_text); + } else { + SubmitForTextCheck(submitted_text); + } } else { SubmitNormalOutputAndExit(result, submitted_text); } @@ -583,11 +588,12 @@ void SoftwareKeyboard::InitializeFrontendKeyboard() { .disable_cancel_button{disable_cancel_button}, }; - frontend.InitializeKeyboard(false, std::move(initialize_parameters), - [this](SwkbdResult result, std::u16string submitted_text) { - SubmitTextNormal(result, submitted_text); - }, - {}); + frontend.InitializeKeyboard( + false, std::move(initialize_parameters), + [this](SwkbdResult result, std::u16string submitted_text, bool confirmed) { + SubmitTextNormal(result, submitted_text, confirmed); + }, + {}); } } diff --git a/src/core/hle/service/am/applets/applet_software_keyboard.h b/src/core/hle/service/am/applets/applet_software_keyboard.h index 6009c10c7..a0fddd965 100755 --- a/src/core/hle/service/am/applets/applet_software_keyboard.h +++ b/src/core/hle/service/am/applets/applet_software_keyboard.h @@ -36,8 +36,9 @@ public: * * @param result SwkbdResult enum * @param submitted_text UTF-16 encoded string + * @param confirmed Whether the text has been confirmed after TextCheckResult::Confirm */ - void SubmitTextNormal(SwkbdResult result, std::u16string submitted_text); + void SubmitTextNormal(SwkbdResult result, std::u16string submitted_text, bool confirmed); /** * Submits the input text to the application. diff --git a/src/yuzu/applets/qt_software_keyboard.cpp b/src/yuzu/applets/qt_software_keyboard.cpp index 36d27307a..de7f98c4f 100755 --- a/src/yuzu/applets/qt_software_keyboard.cpp +++ b/src/yuzu/applets/qt_software_keyboard.cpp @@ -416,7 +416,7 @@ void QtSoftwareKeyboardDialog::ShowTextCheckDialog( ? ui->text_edit_osk->toPlainText().toStdU16String() : ui->line_edit_osk->text().toStdU16String(); - emit SubmitNormalText(SwkbdResult::Ok, std::move(text)); + emit SubmitNormalText(SwkbdResult::Ok, std::move(text), true); break; } } @@ -1520,7 +1520,8 @@ QtSoftwareKeyboard::~QtSoftwareKeyboard() = default; void QtSoftwareKeyboard::InitializeKeyboard( bool is_inline, Core::Frontend::KeyboardInitializeParameters initialize_parameters, - std::function submit_normal_callback_, + std::function + submit_normal_callback_, std::function submit_inline_callback_) { if (is_inline) { @@ -1619,8 +1620,8 @@ void QtSoftwareKeyboard::ExitKeyboard() const { } void QtSoftwareKeyboard::SubmitNormalText(Service::AM::Applets::SwkbdResult result, - std::u16string submitted_text) const { - submit_normal_callback(result, submitted_text); + std::u16string submitted_text, bool confirmed) const { + submit_normal_callback(result, submitted_text, confirmed); } void QtSoftwareKeyboard::SubmitInlineText(Service::AM::Applets::SwkbdReplyType reply_type, diff --git a/src/yuzu/applets/qt_software_keyboard.h b/src/yuzu/applets/qt_software_keyboard.h index dc1689f39..b030cdcf7 100755 --- a/src/yuzu/applets/qt_software_keyboard.h +++ b/src/yuzu/applets/qt_software_keyboard.h @@ -53,8 +53,8 @@ public: void ExitKeyboard(); signals: - void SubmitNormalText(Service::AM::Applets::SwkbdResult result, - std::u16string submitted_text) const; + void SubmitNormalText(Service::AM::Applets::SwkbdResult result, std::u16string submitted_text, + bool confirmed = false) const; void SubmitInlineText(Service::AM::Applets::SwkbdReplyType reply_type, std::u16string submitted_text, s32 cursor_position) const; @@ -236,7 +236,7 @@ public: void InitializeKeyboard( bool is_inline, Core::Frontend::KeyboardInitializeParameters initialize_parameters, - std::function + std::function submit_normal_callback_, std::function submit_inline_callback_) override; @@ -274,13 +274,13 @@ signals: void MainWindowExitKeyboard() const; private: - void SubmitNormalText(Service::AM::Applets::SwkbdResult result, - std::u16string submitted_text) const; + void SubmitNormalText(Service::AM::Applets::SwkbdResult result, std::u16string submitted_text, + bool confirmed) const; void SubmitInlineText(Service::AM::Applets::SwkbdReplyType reply_type, std::u16string submitted_text, s32 cursor_position) const; - mutable std::function + mutable std::function submit_normal_callback; mutable std::function submit_inline_callback; diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index 76f55eb54..24f0f868f 100755 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp @@ -846,6 +846,7 @@ void ConfigureInputPlayer::SetConnectableControllers() { if (!is_powered_on) { add_controllers(true); + return; } add_controllers(false, hid_core.GetSupportedStyleTag()); diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 001f0e350..5ffa0a27a 100755 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -490,8 +490,9 @@ void GMainWindow::SoftwareKeyboardInitialize( } else { connect( software_keyboard, &QtSoftwareKeyboardDialog::SubmitNormalText, this, - [this](Service::AM::Applets::SwkbdResult result, std::u16string submitted_text) { - emit SoftwareKeyboardSubmitNormalText(result, submitted_text); + [this](Service::AM::Applets::SwkbdResult result, std::u16string submitted_text, + bool confirmed) { + emit SoftwareKeyboardSubmitNormalText(result, submitted_text, confirmed); }, Qt::QueuedConnection); } diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 351500743..24633ff2d 100755 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -150,7 +150,7 @@ signals: void ProfileSelectorFinishedSelection(std::optional uuid); void SoftwareKeyboardSubmitNormalText(Service::AM::Applets::SwkbdResult result, - std::u16string submitted_text); + std::u16string submitted_text, bool confirmed); void SoftwareKeyboardSubmitInlineText(Service::AM::Applets::SwkbdReplyType reply_type, std::u16string submitted_text, s32 cursor_position);