104 #define SWKBD_MAX_WORD_LEN 40
106 #define SWKBD_MAX_BUTTON_TEXT_LEN 16
108 #define SWKBD_MAX_HINT_TEXT_LEN 64
110 #define SWKBD_MAX_CALLBACK_MSG_LEN 256
131 const char* initial_text;
146 int is_parental_screen;
147 int darken_top_screen;
149 u32 save_state_flags;
156 bool predictive_input;
164 bool button_submits_text[4];
166 int initial_text_offset;
168 int initial_status_offset;
169 int initial_learning_offset;
170 size_t shared_memory_size;
203 swkbd->password_mode = mode;
215 swkbd->valid_input = validInput;
216 swkbd->filter_flags = filterFlags;
228 swkbd->numpad_keys[0] = left;
229 swkbd->numpad_keys[1] = right;
320 return swkbd->result;
Keyboard dictionary word for predictive input.
Definition: swkbd.h:114
bool all_languages
Specifies if the word applies to all languages.
Definition: swkbd.h:118
u8 language
Language the word applies to.
Definition: swkbd.h:117
Keyboard predictive input learning data.
Definition: swkbd.h:126
Software keyboard parameter structure, it shouldn't be modified directly.
Definition: swkbd.h:141
Keyboard status data.
Definition: swkbd.h:124
void swkbdSetButton(SwkbdState *swkbd, SwkbdButton button, const char *text, bool submit)
Configures a dialog button in a software keyboard.
SwkbdCallbackResult
Keyboard filter callback return values.
Definition: swkbd.h:73
@ SWKBD_CALLBACK_CLOSE
Displays an error message, then closes the keyboard.
Definition: swkbd.h:75
@ SWKBD_CALLBACK_OK
Specifies that the input is valid.
Definition: swkbd.h:74
@ SWKBD_CALLBACK_CONTINUE
Displays an error message and continues displaying the keyboard.
Definition: swkbd.h:76
#define SWKBD_MAX_CALLBACK_MSG_LEN
Maximum filter callback error message length, in UTF-16 code units.
Definition: swkbd.h:110
void swkbdSetInitialText(SwkbdState *swkbd, const char *text)
Sets the initial text that a software keyboard will display on launch.
SwkbdButton swkbdInputText(SwkbdState *swkbd, char *buf, size_t bufsize)
Launches a software keyboard in order to input text.
#define SWKBD_MAX_HINT_TEXT_LEN
Maximum hint text length, in UTF-16 code units.
Definition: swkbd.h:108
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 soft...
void swkbdSetLearningData(SwkbdState *swkbd, SwkbdLearningData *data, bool in, bool out)
Configures software keyboard predictive input learning data management.
void swkbdSetFeatures(SwkbdState *swkbd, u32 features)
Specifies which special features are enabled in a software keyboard.
void swkbdSetDictWord(SwkbdDictWord *word, const char *reading, const char *text)
Configures a word in a predictive dictionary for use with a software keyboard.
SwkbdPasswordMode
Keyboard password modes.
Definition: swkbd.h:40
@ SWKBD_PASSWORD_HIDE
Characters are concealed immediately.
Definition: swkbd.h:42
@ SWKBD_PASSWORD_HIDE_DELAY
Characters are concealed a second after they've been typed.
Definition: swkbd.h:43
@ SWKBD_PASSWORD_NONE
Characters are not concealed.
Definition: swkbd.h:41
static void swkbdSetPasswordMode(SwkbdState *swkbd, SwkbdPasswordMode mode)
Configures password mode in a software keyboard.
Definition: swkbd.h:201
SwkbdButton
Keyboard dialog buttons.
Definition: swkbd.h:30
@ SWKBD_BUTTON_LEFT
Left button (usually Cancel)
Definition: swkbd.h:31
@ SWKBD_BUTTON_RIGHT
Right button (usually OK)
Definition: swkbd.h:33
@ SWKBD_BUTTON_MIDDLE
Middle button (usually I Forgot)
Definition: swkbd.h:32
@ SWKBD_BUTTON_NONE
No button (returned by swkbdInputText in special cases)
Definition: swkbd.h:35
void swkbdSetStatusData(SwkbdState *swkbd, SwkbdStatusData *data, bool in, bool out)
Configures software keyboard internal status management.
static void swkbdSetValidation(SwkbdState *swkbd, SwkbdValidInput validInput, u32 filterFlags, int maxDigits)
Configures input validation in a software keyboard.
Definition: swkbd.h:213
@ SWKBD_FILTER_PROFANITY
Disallow profanity using Nintendo's profanity filter.
Definition: swkbd.h:53
@ SWKBD_FILTER_AT
Disallow the use of the @ sign.
Definition: swkbd.h:50
@ SWKBD_FILTER_CALLBACK
Use a callback in order to check the input.
Definition: swkbd.h:54
@ SWKBD_FILTER_BACKSLASH
Disallow the use of the \ sign.
Definition: swkbd.h:52
@ SWKBD_FILTER_DIGITS
Disallow the use of more than a certain number of digits (0 or more)
Definition: swkbd.h:49
@ SWKBD_FILTER_PERCENT
Disallow the use of the % sign.
Definition: swkbd.h:51
SwkbdValidInput
Accepted input types.
Definition: swkbd.h:19
@ SWKBD_NOTBLANK
Blank inputs (consisting solely of whitespace) are not accepted, but empty inputs are.
Definition: swkbd.h:24
@ SWKBD_NOTEMPTY_NOTBLANK
Empty or blank inputs (consisting solely of whitespace) are not accepted.
Definition: swkbd.h:22
@ SWKBD_FIXEDLEN
The input must have a fixed length (specified by maxTextLength in swkbdInit).
Definition: swkbd.h:25
@ SWKBD_NOTEMPTY
Empty inputs are not accepted.
Definition: swkbd.h:21
@ SWKBD_ANYTHING
All inputs are accepted.
Definition: swkbd.h:20
static SwkbdResult swkbdGetResult(SwkbdState *swkbd)
Retrieves the result condition of a software keyboard after it has been used.
Definition: swkbd.h:318
SwkbdResult
Keyboard return values.
Definition: swkbd.h:81
@ SWKBD_D2_CLICK0
The left button was clicked in 3-button dialogs.
Definition: swkbd.h:89
@ SWKBD_D2_CLICK2
The right button was clicked in 3-button dialogs.
Definition: swkbd.h:91
@ SWKBD_PARENTAL_OK
The parental PIN was verified successfully.
Definition: swkbd.h:97
@ SWKBD_BANNED_INPUT
The filter callback returned SWKBD_CALLBACK_CLOSE.
Definition: swkbd.h:100
@ SWKBD_NONE
Dummy/unused.
Definition: swkbd.h:82
@ SWKBD_D0_CLICK
The button was clicked in 1-button dialogs.
Definition: swkbd.h:86
@ SWKBD_RESETPRESSED
The soft-reset key combination was pressed.
Definition: swkbd.h:94
@ SWKBD_D2_CLICK1
The middle button was clicked in 3-button dialogs.
Definition: swkbd.h:90
@ SWKBD_POWERPRESSED
The POWER button was pressed.
Definition: swkbd.h:95
@ SWKBD_OUTOFMEM
Out of memory.
Definition: swkbd.h:84
@ SWKBD_HOMEPRESSED
The HOME button was pressed.
Definition: swkbd.h:93
@ SWKBD_INVALID_INPUT
Invalid parameters to swkbd.
Definition: swkbd.h:83
@ SWKBD_D1_CLICK1
The right button was clicked in 2-button dialogs.
Definition: swkbd.h:88
@ SWKBD_D1_CLICK0
The left button was clicked in 2-button dialogs.
Definition: swkbd.h:87
@ SWKBD_PARENTAL_FAIL
The parental PIN was incorrect.
Definition: swkbd.h:98
SwkbdCallbackResult(* SwkbdCallbackFn)(void *user, const char **ppMessage, const char *text, size_t textlen)
Keyboard filter callback function.
Definition: swkbd.h:122
#define SWKBD_MAX_BUTTON_TEXT_LEN
Maximum button text length, in UTF-16 code units.
Definition: swkbd.h:106
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 ...
@ SWKBD_ALLOW_POWER
Allow the usage of the POWER button.
Definition: swkbd.h:67
@ SWKBD_PARENTAL
Parental PIN mode.
Definition: swkbd.h:60
@ SWKBD_ALLOW_RESET
Allow the usage of a software-reset combination.
Definition: swkbd.h:66
@ SWKBD_ALLOW_HOME
Allow the usage of the HOME button.
Definition: swkbd.h:65
@ SWKBD_FIXED_WIDTH
Enable fixed-width mode.
Definition: swkbd.h:64
@ SWKBD_MULTILINE
Enable multiline input.
Definition: swkbd.h:63
@ SWKBD_DARKEN_TOP_SCREEN
Darken the top screen when the keyboard is shown.
Definition: swkbd.h:61
@ SWKBD_DEFAULT_QWERTY
Default to the QWERTY page when the keyboard is shown.
Definition: swkbd.h:68
@ SWKBD_PREDICTIVE_INPUT
Enable predictive input (necessary for Kanji input in JPN systems).
Definition: swkbd.h:62
void swkbdInit(SwkbdState *swkbd, SwkbdType type, int numButtons, int maxTextLength)
Initializes software keyboard status.
static void swkbdSetNumpadKeys(SwkbdState *swkbd, int left, int right)
Configures what characters will the two bottom keys in a numpad produce.
Definition: swkbd.h:226
SwkbdType
Keyboard types.
Definition: swkbd.h:10
@ SWKBD_TYPE_NORMAL
Normal keyboard with several pages (QWERTY/accents/symbol/mobile)
Definition: swkbd.h:11
@ SWKBD_TYPE_WESTERN
On JPN systems, a text keyboard without Japanese input capabilities, otherwise same as SWKBD_TYPE_NOR...
Definition: swkbd.h:14
@ SWKBD_TYPE_NUMPAD
Number pad.
Definition: swkbd.h:13
@ SWKBD_TYPE_QWERTY
QWERTY keyboard only.
Definition: swkbd.h:12
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.
#define SWKBD_MAX_WORD_LEN
Maximum dictionary word length, in UTF-16 code units.
Definition: swkbd.h:104
#define BIT(n)
Creates a bitmask from a bit number.
Definition: types.h:47
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
uint16_t u16
16-bit unsigned integer
Definition: types.h:22
uint32_t u32
32-bit unsigned integer
Definition: types.h:23