MCPcopy Create free account
hub / github.com/XorTroll/Goldleaf / ShowKeyboard

Function ShowKeyboard

Goldleaf/source/ui/ui_Utils.cpp:64–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62 }
63
64 std::string ShowKeyboard(const std::string &guide_text, const std::string &initial_text, const u32 max_len, const size_t out_str_len) {
65 SwkbdConfig kbd;
66 auto rc = swkbdCreate(&kbd, 0);
67 if(R_SUCCEEDED(rc)) {
68 swkbdConfigMakePresetDefault(&kbd);
69 swkbdConfigSetType(&kbd, SwkbdType_All);
70 swkbdConfigSetStringLenMax(&kbd, max_len);
71 if(!guide_text.empty()) {
72 swkbdConfigSetGuideText(&kbd, guide_text.c_str());
73 }
74 if(!initial_text.empty()) {
75 swkbdConfigSetInitialText(&kbd, initial_text.c_str());
76 }
77
78 auto out_text = new char[out_str_len + 1]();
79 rc = swkbdShow(&kbd, out_text, out_str_len + 1);
80 std::string out(out_text);
81 delete[] out_text;
82 swkbdClose(&kbd);
83
84 if(R_SUCCEEDED(rc)) {
85 return out;
86 }
87 }
88
89 return "";
90 }
91
92 void HandleResult(const Result rc, const std::string &info) {
93 if(R_FAILED(rc)) {

Callers 7

StartDumpMethod · 0.85
OnInputMethod · 0.85
OnFileSelectedMethod · 0.85
OnDirectorySelectedMethod · 0.85
input_DefaultKeyMethod · 0.85
bookmark_DefaultKeyMethod · 0.85
optsRename_DefaultKeyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected