summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Morph2021-11-08 13:05:50 -0500
committerGravatar Morph2021-11-08 13:05:50 -0500
commit1af499c15b35ee0cd7a90262d91feb874bed55db (patch)
tree71f1af22ca33f8c7c51706c2fc72c8f2f89744b1 /src/core
parentservice/pctl: Stub EndFreeCommunication (diff)
downloadyuzu-1af499c15b35ee0cd7a90262d91feb874bed55db.tar.gz
yuzu-1af499c15b35ee0cd7a90262d91feb874bed55db.tar.xz
yuzu-1af499c15b35ee0cd7a90262d91feb874bed55db.zip
applets/swkbd: Skip text checking if the text has been confirmed
Confirm means that the text has already been checked by the application to be correct, but is asking the user for confirmation. The confirmation text itself seems to be corrupted though, this needs to be investigated. Fixes the software keyboard in Famicom Detective Club: The Missing Heir
Diffstat (limited to 'src/core')
-rw-r--r--src/core/frontend/applets/software_keyboard.cpp5
-rw-r--r--src/core/frontend/applets/software_keyboard.h6
-rw-r--r--src/core/hle/service/am/applets/applet_software_keyboard.cpp20
-rw-r--r--src/core/hle/service/am/applets/applet_software_keyboard.h3
4 files changed, 21 insertions, 13 deletions
diff --git a/src/core/frontend/applets/software_keyboard.cpp b/src/core/frontend/applets/software_keyboard.cpp
index 12c76c9ee..c4863ee73 100644
--- a/src/core/frontend/applets/software_keyboard.cpp
+++ b/src/core/frontend/applets/software_keyboard.cpp
@@ -16,7 +16,8 @@ DefaultSoftwareKeyboardApplet::~DefaultSoftwareKeyboardApplet() = default;
16 16
17void DefaultSoftwareKeyboardApplet::InitializeKeyboard( 17void DefaultSoftwareKeyboardApplet::InitializeKeyboard(
18 bool is_inline, KeyboardInitializeParameters initialize_parameters, 18 bool is_inline, KeyboardInitializeParameters initialize_parameters,
19 std::function<void(Service::AM::Applets::SwkbdResult, std::u16string)> submit_normal_callback_, 19 std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)>
20 submit_normal_callback_,
20 std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> 21 std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)>
21 submit_inline_callback_) { 22 submit_inline_callback_) {
22 if (is_inline) { 23 if (is_inline) {
@@ -128,7 +129,7 @@ void DefaultSoftwareKeyboardApplet::ExitKeyboard() const {
128} 129}
129 130
130void DefaultSoftwareKeyboardApplet::SubmitNormalText(std::u16string text) const { 131void DefaultSoftwareKeyboardApplet::SubmitNormalText(std::u16string text) const {
131 submit_normal_callback(Service::AM::Applets::SwkbdResult::Ok, text); 132 submit_normal_callback(Service::AM::Applets::SwkbdResult::Ok, text, true);
132} 133}
133 134
134void DefaultSoftwareKeyboardApplet::SubmitInlineText(std::u16string_view text) const { 135void 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 100644
--- a/src/core/frontend/applets/software_keyboard.h
+++ b/src/core/frontend/applets/software_keyboard.h
@@ -57,7 +57,7 @@ public:
57 57
58 virtual void InitializeKeyboard( 58 virtual void InitializeKeyboard(
59 bool is_inline, KeyboardInitializeParameters initialize_parameters, 59 bool is_inline, KeyboardInitializeParameters initialize_parameters,
60 std::function<void(Service::AM::Applets::SwkbdResult, std::u16string)> 60 std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)>
61 submit_normal_callback_, 61 submit_normal_callback_,
62 std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> 62 std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)>
63 submit_inline_callback_) = 0; 63 submit_inline_callback_) = 0;
@@ -82,7 +82,7 @@ public:
82 82
83 void InitializeKeyboard( 83 void InitializeKeyboard(
84 bool is_inline, KeyboardInitializeParameters initialize_parameters, 84 bool is_inline, KeyboardInitializeParameters initialize_parameters,
85 std::function<void(Service::AM::Applets::SwkbdResult, std::u16string)> 85 std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)>
86 submit_normal_callback_, 86 submit_normal_callback_,
87 std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> 87 std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)>
88 submit_inline_callback_) override; 88 submit_inline_callback_) override;
@@ -106,7 +106,7 @@ private:
106 106
107 KeyboardInitializeParameters parameters; 107 KeyboardInitializeParameters parameters;
108 108
109 mutable std::function<void(Service::AM::Applets::SwkbdResult, std::u16string)> 109 mutable std::function<void(Service::AM::Applets::SwkbdResult, std::u16string, bool)>
110 submit_normal_callback; 110 submit_normal_callback;
111 mutable std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)> 111 mutable std::function<void(Service::AM::Applets::SwkbdReplyType, std::u16string, s32)>
112 submit_inline_callback; 112 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 100644
--- 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() {
109 ShowNormalKeyboard(); 109 ShowNormalKeyboard();
110} 110}
111 111
112void SoftwareKeyboard::SubmitTextNormal(SwkbdResult result, std::u16string submitted_text) { 112void SoftwareKeyboard::SubmitTextNormal(SwkbdResult result, std::u16string submitted_text,
113 bool confirmed) {
113 if (complete) { 114 if (complete) {
114 return; 115 return;
115 } 116 }
116 117
117 if (swkbd_config_common.use_text_check && result == SwkbdResult::Ok) { 118 if (swkbd_config_common.use_text_check && result == SwkbdResult::Ok) {
118 SubmitForTextCheck(submitted_text); 119 if (confirmed) {
120 SubmitNormalOutputAndExit(result, submitted_text);
121 } else {
122 SubmitForTextCheck(submitted_text);
123 }
119 } else { 124 } else {
120 SubmitNormalOutputAndExit(result, submitted_text); 125 SubmitNormalOutputAndExit(result, submitted_text);
121 } 126 }
@@ -583,11 +588,12 @@ void SoftwareKeyboard::InitializeFrontendKeyboard() {
583 .disable_cancel_button{disable_cancel_button}, 588 .disable_cancel_button{disable_cancel_button},
584 }; 589 };
585 590
586 frontend.InitializeKeyboard(false, std::move(initialize_parameters), 591 frontend.InitializeKeyboard(
587 [this](SwkbdResult result, std::u16string submitted_text) { 592 false, std::move(initialize_parameters),
588 SubmitTextNormal(result, submitted_text); 593 [this](SwkbdResult result, std::u16string submitted_text, bool confirmed) {
589 }, 594 SubmitTextNormal(result, submitted_text, confirmed);
590 {}); 595 },
596 {});
591 } 597 }
592} 598}
593 599
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 100644
--- 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:
36 * 36 *
37 * @param result SwkbdResult enum 37 * @param result SwkbdResult enum
38 * @param submitted_text UTF-16 encoded string 38 * @param submitted_text UTF-16 encoded string
39 * @param confirmed Whether the text has been confirmed after TextCheckResult::Confirm
39 */ 40 */
40 void SubmitTextNormal(SwkbdResult result, std::u16string submitted_text); 41 void SubmitTextNormal(SwkbdResult result, std::u16string submitted_text, bool confirmed);
41 42
42 /** 43 /**
43 * Submits the input text to the application. 44 * Submits the input text to the application.