summaryrefslogtreecommitdiffstats
path: root/src/core/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/frontend')
-rw-r--r--src/core/frontend/applets/software_keyboard.cpp7
-rw-r--r--src/core/frontend/applets/software_keyboard.h7
2 files changed, 9 insertions, 5 deletions
diff --git a/src/core/frontend/applets/software_keyboard.cpp b/src/core/frontend/applets/software_keyboard.cpp
index 2445a980d..4105101b3 100644
--- a/src/core/frontend/applets/software_keyboard.cpp
+++ b/src/core/frontend/applets/software_keyboard.cpp
@@ -9,12 +9,13 @@
namespace Core::Frontend {
SoftwareKeyboardApplet::~SoftwareKeyboardApplet() = default;
-std::optional<std::u16string> DefaultSoftwareKeyboardApplet::GetText(
+void DefaultSoftwareKeyboardApplet::RequestText(
+ std::function<void(std::optional<std::u16string>)> out,
SoftwareKeyboardParameters parameters) const {
if (parameters.initial_text.empty())
- return u"yuzu";
+ out(u"yuzu");
- return parameters.initial_text;
+ out(parameters.initial_text);
}
void DefaultSoftwareKeyboardApplet::SendTextCheckDialog(std::u16string error_message) const {
diff --git a/src/core/frontend/applets/software_keyboard.h b/src/core/frontend/applets/software_keyboard.h
index 7387ee8d7..5420ea883 100644
--- a/src/core/frontend/applets/software_keyboard.h
+++ b/src/core/frontend/applets/software_keyboard.h
@@ -4,6 +4,7 @@
#pragma once
+#include <functional>
#include <optional>
#include <string>
#include "common/bit_field.h"
@@ -36,13 +37,15 @@ class SoftwareKeyboardApplet {
public:
virtual ~SoftwareKeyboardApplet();
- virtual std::optional<std::u16string> GetText(SoftwareKeyboardParameters parameters) const = 0;
+ virtual void RequestText(std::function<void(std::optional<std::u16string>)> out,
+ SoftwareKeyboardParameters parameters) const = 0;
virtual void SendTextCheckDialog(std::u16string error_message) const = 0;
};
class DefaultSoftwareKeyboardApplet final : public SoftwareKeyboardApplet {
public:
- std::optional<std::u16string> GetText(SoftwareKeyboardParameters parameters) const override;
+ void RequestText(std::function<void(std::optional<std::u16string>)> out,
+ SoftwareKeyboardParameters parameters) const override;
void SendTextCheckDialog(std::u16string error_message) const override;
};