libctru
v2.4.1
|
Software keyboard applet. More...
#include <3ds/types.h>
Go to the source code of this file.
Data Structures | |
struct | SwkbdDictWord |
Keyboard dictionary word for predictive input. More... | |
struct | SwkbdStatusData |
Keyboard status data. More... | |
struct | SwkbdLearningData |
Keyboard predictive input learning data. More... | |
struct | SwkbdExtra |
Internal libctru book-keeping structure for software keyboards. More... | |
struct | SwkbdState |
Software keyboard parameter structure, it shouldn't be modified directly. More... | |
Macros | |
#define | SWKBD_MAX_WORD_LEN 40 |
Maximum dictionary word length, in UTF-16 code units. | |
#define | SWKBD_MAX_BUTTON_TEXT_LEN 16 |
Maximum button text length, in UTF-16 code units. | |
#define | SWKBD_MAX_HINT_TEXT_LEN 64 |
Maximum hint text length, in UTF-16 code units. | |
#define | SWKBD_MAX_CALLBACK_MSG_LEN 256 |
Maximum filter callback error message length, in UTF-16 code units. | |
Typedefs | |
typedef SwkbdCallbackResult(* | SwkbdCallbackFn) (void *user, const char **ppMessage, const char *text, size_t textlen) |
Keyboard filter callback function. | |
Functions | |
void | swkbdInit (SwkbdState *swkbd, SwkbdType type, int numButtons, int maxTextLength) |
Initializes software keyboard status. More... | |
static void | swkbdSetPasswordMode (SwkbdState *swkbd, SwkbdPasswordMode mode) |
Configures password mode in a software keyboard. More... | |
static void | swkbdSetValidation (SwkbdState *swkbd, SwkbdValidInput validInput, u32 filterFlags, int maxDigits) |
Configures input validation in a software keyboard. More... | |
static void | swkbdSetNumpadKeys (SwkbdState *swkbd, int left, int right) |
Configures what characters will the two bottom keys in a numpad produce. More... | |
void | swkbdSetFeatures (SwkbdState *swkbd, u32 features) |
Specifies which special features are enabled in a software keyboard. More... | |
void | swkbdSetHintText (SwkbdState *swkbd, const char *text) |
Sets the hint text of a software keyboard (that is, the help text that is displayed when the textbox is empty). More... | |
void | swkbdSetButton (SwkbdState *swkbd, SwkbdButton button, const char *text, bool submit) |
Configures a dialog button in a software keyboard. More... | |
void | swkbdSetInitialText (SwkbdState *swkbd, const char *text) |
Sets the initial text that a software keyboard will display on launch. More... | |
void | swkbdSetDictWord (SwkbdDictWord *word, const char *reading, const char *text) |
Configures a word in a predictive dictionary for use with a software keyboard. More... | |
void | swkbdSetDictionary (SwkbdState *swkbd, const SwkbdDictWord *dict, int wordCount) |
Sets the custom word dictionary to be used with the predictive input system of a software keyboard. More... | |
void | swkbdSetStatusData (SwkbdState *swkbd, SwkbdStatusData *data, bool in, bool out) |
Configures software keyboard internal status management. More... | |
void | swkbdSetLearningData (SwkbdState *swkbd, SwkbdLearningData *data, bool in, bool out) |
Configures software keyboard predictive input learning data management. More... | |
void | swkbdSetFilterCallback (SwkbdState *swkbd, SwkbdCallbackFn callback, void *user) |
Configures a custom function to be used to check the validity of input when it is submitted in a software keyboard. More... | |
SwkbdButton | swkbdInputText (SwkbdState *swkbd, char *buf, size_t bufsize) |
Launches a software keyboard in order to input text. More... | |
static SwkbdResult | swkbdGetResult (SwkbdState *swkbd) |
Retrieves the result condition of a software keyboard after it has been used. More... | |
Software keyboard applet.
anonymous enum |
Keyboard input filtering flags.
anonymous enum |
Keyboard features.
enum SwkbdButton |
enum SwkbdCallbackResult |
enum SwkbdPasswordMode |
enum SwkbdResult |
Keyboard return values.
enum SwkbdType |
Keyboard types.
enum SwkbdValidInput |
Accepted input types.
|
inlinestatic |
Retrieves the result condition of a software keyboard after it has been used.
swkbd | Pointer to swkbd state. |
void swkbdInit | ( | SwkbdState * | swkbd, |
SwkbdType | type, | ||
int | numButtons, | ||
int | maxTextLength | ||
) |
Initializes software keyboard status.
swkbd | Pointer to swkbd state. |
type | Keyboard type. |
numButtons | Number of dialog buttons to display (1, 2 or 3). |
maxTextLength | Maximum number of UTF-16 code units that input text can have (or -1 to let libctru use a big default). |
SwkbdButton swkbdInputText | ( | SwkbdState * | swkbd, |
char * | buf, | ||
size_t | bufsize | ||
) |
Launches a software keyboard in order to input text.
swkbd | Pointer to swkbd state. |
buf | Pointer to output buffer which will hold the inputted text. |
bufsize | Maximum number of UTF-8 code units that the buffer can hold (including null terminator). |
void swkbdSetButton | ( | SwkbdState * | swkbd, |
SwkbdButton | button, | ||
const char * | text, | ||
bool | submit | ||
) |
Configures a dialog button in a software keyboard.
swkbd | Pointer to swkbd state. |
button | Specifies which button to configure. |
text | Button text. |
submit | Specifies whether pushing the button will submit the text or discard it. |
void swkbdSetDictionary | ( | SwkbdState * | swkbd, |
const SwkbdDictWord * | dict, | ||
int | wordCount | ||
) |
Sets the custom word dictionary to be used with the predictive input system of a software keyboard.
swkbd | Pointer to swkbd state. |
dict | Pointer to dictionary words. |
wordCount | Number of words in the dictionary. |
void swkbdSetDictWord | ( | SwkbdDictWord * | word, |
const char * | reading, | ||
const char * | text | ||
) |
Configures a word in a predictive dictionary for use with a software keyboard.
word | Pointer to dictionary word structure. |
reading | Reading of the word, that is, the sequence of characters that need to be typed to trigger the word in the predictive input system. |
text | Spelling of the word, that is, the actual characters that will be produced when the user decides to select the word. |
void swkbdSetFeatures | ( | SwkbdState * | swkbd, |
u32 | features | ||
) |
Specifies which special features are enabled in a software keyboard.
swkbd | Pointer to swkbd state. |
features | Feature bitmask. |
void swkbdSetFilterCallback | ( | SwkbdState * | swkbd, |
SwkbdCallbackFn | callback, | ||
void * | user | ||
) |
Configures a custom function to be used to check the validity of input when it is submitted in a software keyboard.
swkbd | Pointer to swkbd state. |
callback | Filter callback function. |
user | Custom data to be passed to the callback function. |
void swkbdSetHintText | ( | SwkbdState * | swkbd, |
const char * | text | ||
) |
Sets the hint text of a software keyboard (that is, the help text that is displayed when the textbox is empty).
swkbd | Pointer to swkbd state. |
text | Hint text. |
void swkbdSetInitialText | ( | SwkbdState * | swkbd, |
const char * | text | ||
) |
Sets the initial text that a software keyboard will display on launch.
swkbd | Pointer to swkbd state. |
text | Initial text. |
void swkbdSetLearningData | ( | SwkbdState * | swkbd, |
SwkbdLearningData * | data, | ||
bool | in, | ||
bool | out | ||
) |
Configures software keyboard predictive input learning data management.
swkbd | Pointer to swkbd state. |
data | Pointer to learning data structure (can be in, out or both depending on the other parameters). |
in | Specifies whether the data should be read from the structure when the keyboard is launched. |
out | Specifies whether the data should be written to the structure when the keyboard is closed. |
|
inlinestatic |
Configures what characters will the two bottom keys in a numpad produce.
swkbd | Pointer to swkbd state. |
left | Unicode codepoint produced by the leftmost key in the bottom row (0 hides the key). |
left | Unicode codepoint produced by the rightmost key in the bottom row (0 hides the key). |
|
inlinestatic |
Configures password mode in a software keyboard.
swkbd | Pointer to swkbd state. |
mode | Password mode. |
void swkbdSetStatusData | ( | SwkbdState * | swkbd, |
SwkbdStatusData * | data, | ||
bool | in, | ||
bool | out | ||
) |
Configures software keyboard internal status management.
swkbd | Pointer to swkbd state. |
data | Pointer to internal status structure (can be in, out or both depending on the other parameters). |
in | Specifies whether the data should be read from the structure when the keyboard is launched. |
out | Specifies whether the data should be written to the structure when the keyboard is closed. |
|
inlinestatic |
Configures input validation in a software keyboard.
swkbd | Pointer to swkbd state. |
validInput | Specifies which inputs are valid. |
filterFlags | Bitmask specifying which characters are disallowed (filtered). |
maxDigits | In case digits are disallowed, specifies how many digits are allowed at maximum in input strings (0 completely restricts digit input). |