Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

applets/swkbd: Add callback support #4700

Merged
merged 3 commits into from Apr 20, 2019

Conversation

zhaowenlan1779
Copy link
Member

@zhaowenlan1779 zhaowenlan1779 commented Mar 17, 2019

Implements callbacks in the HLE swkbd applet by sending the config (containing text offset and length) as a parameter of signal type Message. The application should then send the callback result parameter, also using signal type Message.

If the result is Close, an error dialog will be shown and then the applet will exit with code BannedInput. If the result is Continue, an error dialog will be shown and the user will be asked for input again.

Slight cleanups are also done to the code like replacing pointers with references.

Fix #4568


This change is Reviewable

Copy link
Member

@wwylele wwylele left a comment

Overall LGTM

src/core/hle/applets/swkbd.cpp Outdated Show resolved Hide resolved
src/core/frontend/applets/swkbd.h Outdated Show resolved Hide resolved
@@ -117,11 +133,14 @@ class SoftwareKeyboard {
protected:
KeyboardConfig config;
KeyboardData data;

std::atomic_bool data_ready = false;
Copy link
Member

@wwylele wwylele Mar 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My gut tells me this kind of construction could be converted to std::future<KeyboardData> data. I am not sure about the real reason, so I just say this as a reference.

src/core/hle/applets/swkbd.cpp Outdated Show resolved Hide resolved
src/core/hle/applets/swkbd.cpp Outdated Show resolved Hide resolved
src/core/hle/applets/swkbd.cpp Outdated Show resolved Hide resolved
@zhaowenlan1779
Copy link
Member Author

zhaowenlan1779 commented Apr 20, 2019

I'll merge this soon if no more comments.

@zhaowenlan1779 zhaowenlan1779 merged commit 536e4de into citra-emu:master Apr 20, 2019
3 checks passed
@zhaowenlan1779 zhaowenlan1779 deleted the swkbd-2 branch Apr 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants