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

Method text

3ds/source/KeyboardManager.cpp:38–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38std::string KeyboardManager::text(const std::string& suggestion, const std::string& hint, size_t maxLen)
39{
40 SwkbdState swkbd;
41 const size_t kBufSize = 64;
42 size_t limit = std::min(maxLen, kBufSize);
43 if (limit < 2) {
44 limit = 2;
45 }
46 swkbdInit(&swkbd, SWKBD_TYPE_NORMAL, 2, limit - 1);
47 swkbdSetValidation(&swkbd, SWKBD_NOTBLANK_NOTEMPTY, 0, 0);
48 swkbdSetInitialText(&swkbd, suggestion.c_str());
49 swkbdSetHintText(&swkbd, hint.c_str());
50 char buf[kBufSize] = {0};
51 SwkbdButton button = swkbdInputText(&swkbd, buf, sizeof(buf));
52 buf[sizeof(buf) - 1] = '\0';
53 return button == SWKBD_BUTTON_CONFIRM ? std::string(buf) : std::string();
54}
55
56int KeyboardManager::numpad(const std::string& hint, int min, int max)
57{

Callers 3

keyboardMethod · 0.45
drawBottomMethod · 0.45
startTransferSendMethod · 0.45

Calls 1

stringFunction · 0.85

Tested by

no test coverage detected