MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / text

Method text

3ds/source/KeyboardManager.cpp:12–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10}
11
12std::string KeyboardManager::text(const std::string& suggestion, const std::string& hint, size_t maxLen)
13{
14 SwkbdState swkbd;
15 const size_t kBufSize = 64;
16 size_t limit = std::min(maxLen, kBufSize);
17 if (limit < 2) {
18 limit = 2;
19 }
20 swkbdInit(&swkbd, SWKBD_TYPE_NORMAL, 2, limit - 1);
21 swkbdSetValidation(&swkbd, SWKBD_NOTBLANK_NOTEMPTY, 0, 0);
22 swkbdSetInitialText(&swkbd, suggestion.c_str());
23 swkbdSetHintText(&swkbd, hint.c_str());
24 char buf[kBufSize] = {0};
25 SwkbdButton button = swkbdInputText(&swkbd, buf, sizeof(buf));
26 buf[sizeof(buf) - 1] = '\0';
27 return button == SWKBD_BUTTON_CONFIRM ? std::string(buf) : std::string();
28}
29
30int KeyboardManager::numericPad(void)
31{

Callers 2

drawBottomMethod · 0.45
startTransferSendMethod · 0.45

Calls 1

stringFunction · 0.85

Tested by

no test coverage detected