libctru  v2.3.1
swkbd.h
Go to the documentation of this file.
1 /**
2  * @file swkbd.h
3  * @brief Software keyboard applet.
4  */
5 #pragma once
6 #include <3ds/types.h>
7 
8 /// Keyboard types.
9 typedef enum
10 {
11  SWKBD_TYPE_NORMAL = 0, ///< Normal keyboard with several pages (QWERTY/accents/symbol/mobile)
12  SWKBD_TYPE_QWERTY, ///< QWERTY keyboard only.
13  SWKBD_TYPE_NUMPAD, ///< Number pad.
14  SWKBD_TYPE_WESTERN, ///< On JPN systems, a text keyboard without Japanese input capabilities, otherwise same as SWKBD_TYPE_NORMAL.
15 } SwkbdType;
16 
17 /// Accepted input types.
18 typedef enum
19 {
20  SWKBD_ANYTHING = 0, ///< All inputs are accepted.
21  SWKBD_NOTEMPTY, ///< Empty inputs are not accepted.
22  SWKBD_NOTEMPTY_NOTBLANK, ///< Empty or blank inputs (consisting solely of whitespace) are not accepted.
23  SWKBD_NOTBLANK_NOTEMPTY = SWKBD_NOTEMPTY_NOTBLANK,
24  SWKBD_NOTBLANK, ///< Blank inputs (consisting solely of whitespace) are not accepted, but empty inputs are.
25  SWKBD_FIXEDLEN, ///< The input must have a fixed length (specified by maxTextLength in swkbdInit).
27 
28 /// Keyboard dialog buttons.
29 typedef enum
30 {
31  SWKBD_BUTTON_LEFT = 0, ///< Left button (usually Cancel)
32  SWKBD_BUTTON_MIDDLE, ///< Middle button (usually I Forgot)
33  SWKBD_BUTTON_RIGHT, ///< Right button (usually OK)
34  SWKBD_BUTTON_CONFIRM = SWKBD_BUTTON_RIGHT,
35  SWKBD_BUTTON_NONE, ///< No button (returned by swkbdInputText in special cases)
36 } SwkbdButton;
37 
38 /// Keyboard password modes.
39 typedef enum
40 {
41  SWKBD_PASSWORD_NONE = 0, ///< Characters are not concealed.
42  SWKBD_PASSWORD_HIDE, ///< Characters are concealed immediately.
43  SWKBD_PASSWORD_HIDE_DELAY, ///< Characters are concealed a second after they've been typed.
45 
46 /// Keyboard input filtering flags.
47 enum
48 {
49  SWKBD_FILTER_DIGITS = BIT(0), ///< Disallow the use of more than a certain number of digits (0 or more)
50  SWKBD_FILTER_AT = BIT(1), ///< Disallow the use of the @ sign.
51  SWKBD_FILTER_PERCENT = BIT(2), ///< Disallow the use of the % sign.
52  SWKBD_FILTER_BACKSLASH = BIT(3), ///< Disallow the use of the \ sign.
53  SWKBD_FILTER_PROFANITY = BIT(4), ///< Disallow profanity using Nintendo's profanity filter.
54  SWKBD_FILTER_CALLBACK = BIT(5), ///< Use a callback in order to check the input.
55 };
56 
57 /// Keyboard features.
58 enum
59 {
60  SWKBD_PARENTAL = BIT(0), ///< Parental PIN mode.
61  SWKBD_DARKEN_TOP_SCREEN = BIT(1), ///< Darken the top screen when the keyboard is shown.
62  SWKBD_PREDICTIVE_INPUT = BIT(2), ///< Enable predictive input (necessary for Kanji input in JPN systems).
63  SWKBD_MULTILINE = BIT(3), ///< Enable multiline input.
64  SWKBD_FIXED_WIDTH = BIT(4), ///< Enable fixed-width mode.
65  SWKBD_ALLOW_HOME = BIT(5), ///< Allow the usage of the HOME button.
66  SWKBD_ALLOW_RESET = BIT(6), ///< Allow the usage of a software-reset combination.
67  SWKBD_ALLOW_POWER = BIT(7), ///< Allow the usage of the POWER button.
68  SWKBD_DEFAULT_QWERTY = BIT(9), ///< Default to the QWERTY page when the keyboard is shown.
69 };
70 
71 /// Keyboard filter callback return values.
72 typedef enum
73 {
74  SWKBD_CALLBACK_OK = 0, ///< Specifies that the input is valid.
75  SWKBD_CALLBACK_CLOSE, ///< Displays an error message, then closes the keyboard.
76  SWKBD_CALLBACK_CONTINUE, ///< Displays an error message and continues displaying the keyboard.
78 
79 /// Keyboard return values.
80 typedef enum
81 {
82  SWKBD_NONE = -1, ///< Dummy/unused.
83  SWKBD_INVALID_INPUT = -2, ///< Invalid parameters to swkbd.
84  SWKBD_OUTOFMEM = -3, ///< Out of memory.
85 
86  SWKBD_D0_CLICK = 0, ///< The button was clicked in 1-button dialogs.
87  SWKBD_D1_CLICK0, ///< The left button was clicked in 2-button dialogs.
88  SWKBD_D1_CLICK1, ///< The right button was clicked in 2-button dialogs.
89  SWKBD_D2_CLICK0, ///< The left button was clicked in 3-button dialogs.
90  SWKBD_D2_CLICK1, ///< The middle button was clicked in 3-button dialogs.
91  SWKBD_D2_CLICK2, ///< The right button was clicked in 3-button dialogs.
92 
93  SWKBD_HOMEPRESSED = 10, ///< The HOME button was pressed.
94  SWKBD_RESETPRESSED, ///< The soft-reset key combination was pressed.
95  SWKBD_POWERPRESSED, ///< The POWER button was pressed.
96 
97  SWKBD_PARENTAL_OK = 20, ///< The parental PIN was verified successfully.
98  SWKBD_PARENTAL_FAIL, ///< The parental PIN was incorrect.
99 
100  SWKBD_BANNED_INPUT = 30, ///< The filter callback returned SWKBD_CALLBACK_CLOSE.
101 } SwkbdResult;
102 
103 /// Maximum dictionary word length, in UTF-16 code units.
104 #define SWKBD_MAX_WORD_LEN 40
105 /// Maximum button text length, in UTF-16 code units.
106 #define SWKBD_MAX_BUTTON_TEXT_LEN 16
107 /// Maximum hint text length, in UTF-16 code units.
108 #define SWKBD_MAX_HINT_TEXT_LEN 64
109 /// Maximum filter callback error message length, in UTF-16 code units.
110 #define SWKBD_MAX_CALLBACK_MSG_LEN 256
111 
112 /// Keyboard dictionary word for predictive input.
113 typedef struct
114 {
115  u16 reading[SWKBD_MAX_WORD_LEN+1]; ///< Reading of the word (that is, the string that needs to be typed).
116  u16 word[SWKBD_MAX_WORD_LEN+1]; ///< Spelling of the word.
117  u8 language; ///< Language the word applies to.
118  bool all_languages; ///< Specifies if the word applies to all languages.
119 } SwkbdDictWord;
120 
121 /// Keyboard filter callback function.
122 typedef SwkbdCallbackResult (* SwkbdCallbackFn)(void* user, const char** ppMessage, const char* text, size_t textlen);
123 /// Keyboard status data.
124 typedef struct { u32 data[0x11]; } SwkbdStatusData;
125 /// Keyboard predictive input learning data.
126 typedef struct { u32 data[0x291B]; } SwkbdLearningData;
127 
128 /// Internal libctru book-keeping structure for software keyboards.
129 typedef struct
130 {
131  const char* initial_text;
132  const SwkbdDictWord* dict;
133  SwkbdStatusData* status_data;
134  SwkbdLearningData* learning_data;
135  SwkbdCallbackFn callback;
136  void* callback_user;
137 } SwkbdExtra;
138 
139 /// Software keyboard parameter structure, it shouldn't be modified directly.
140 typedef struct
141 {
142  int type;
143  int num_buttons_m1;
144  int valid_input;
145  int password_mode;
146  int is_parental_screen;
147  int darken_top_screen;
148  u32 filter_flags;
149  u32 save_state_flags;
150  u16 max_text_len;
151  u16 dict_word_count;
152  u16 max_digits;
153  u16 button_text[3][SWKBD_MAX_BUTTON_TEXT_LEN+1];
154  u16 numpad_keys[2];
155  u16 hint_text[SWKBD_MAX_HINT_TEXT_LEN+1];
156  bool predictive_input;
157  bool multiline;
158  bool fixed_width;
159  bool allow_home;
160  bool allow_reset;
161  bool allow_power;
162  bool unknown; // XX: what is this supposed to do? "communicateWithOtherRegions"
163  bool default_qwerty;
164  bool button_submits_text[4];
165  u16 language; // XX: not working? supposedly 0 = use system language, CFG_Language+1 = pick language
166  int initial_text_offset;
167  int dict_offset;
168  int initial_status_offset;
169  int initial_learning_offset;
170  size_t shared_memory_size;
171  u32 version;
172  SwkbdResult result;
173  int status_offset;
174  int learning_offset;
175  int text_offset;
176  u16 text_length;
177  int callback_result;
178  u16 callback_msg[SWKBD_MAX_CALLBACK_MSG_LEN+1];
179  bool skip_at_check;
180  union
181  {
182  u8 reserved[171];
183  SwkbdExtra extra;
184  };
185 } SwkbdState;
186 
187 /**
188  * @brief Initializes software keyboard status.
189  * @param swkbd Pointer to swkbd state.
190  * @param type Keyboard type.
191  * @param numButtons Number of dialog buttons to display (1, 2 or 3).
192  * @param maxTextLength Maximum number of UTF-16 code units that input text can have (or -1 to let libctru use a big default).
193  */
194 void swkbdInit(SwkbdState* swkbd, SwkbdType type, int numButtons, int maxTextLength);
195 
196 /**
197  * @brief Configures password mode in a software keyboard.
198  * @param swkbd Pointer to swkbd state.
199  * @param mode Password mode.
200  */
201 static inline void swkbdSetPasswordMode(SwkbdState* swkbd, SwkbdPasswordMode mode)
202 {
203  swkbd->password_mode = mode;
204 }
205 
206 /**
207  * @brief Configures input validation in a software keyboard.
208  * @param swkbd Pointer to swkbd state.
209  * @param validInput Specifies which inputs are valid.
210  * @param filterFlags Bitmask specifying which characters are disallowed (filtered).
211  * @param maxDigits In case digits are disallowed, specifies how many digits are allowed at maximum in input strings (0 completely restricts digit input).
212  */
213 static inline void swkbdSetValidation(SwkbdState* swkbd, SwkbdValidInput validInput, u32 filterFlags, int maxDigits)
214 {
215  swkbd->valid_input = validInput;
216  swkbd->filter_flags = filterFlags;
217  swkbd->max_digits = (filterFlags & SWKBD_FILTER_DIGITS) ? maxDigits : 0;
218 }
219 
220 /**
221  * @brief Configures what characters will the two bottom keys in a numpad produce.
222  * @param swkbd Pointer to swkbd state.
223  * @param left Unicode codepoint produced by the leftmost key in the bottom row (0 hides the key).
224  * @param left Unicode codepoint produced by the rightmost key in the bottom row (0 hides the key).
225  */
226 static inline void swkbdSetNumpadKeys(SwkbdState* swkbd, int left, int right)
227 {
228  swkbd->numpad_keys[0] = left;
229  swkbd->numpad_keys[1] = right;
230 }
231 
232 /**
233  * @brief Specifies which special features are enabled in a software keyboard.
234  * @param swkbd Pointer to swkbd state.
235  * @param features Feature bitmask.
236  */
237 void swkbdSetFeatures(SwkbdState* swkbd, u32 features);
238 
239 /**
240  * @brief Sets the hint text of a software keyboard (that is, the help text that is displayed when the textbox is empty).
241  * @param swkbd Pointer to swkbd state.
242  * @param text Hint text.
243  */
244 void swkbdSetHintText(SwkbdState* swkbd, const char* text);
245 
246 /**
247  * @brief Configures a dialog button in a software keyboard.
248  * @param swkbd Pointer to swkbd state.
249  * @param button Specifies which button to configure.
250  * @param text Button text.
251  * @param submit Specifies whether pushing the button will submit the text or discard it.
252  */
253 void swkbdSetButton(SwkbdState* swkbd, SwkbdButton button, const char* text, bool submit);
254 
255 /**
256  * @brief Sets the initial text that a software keyboard will display on launch.
257  * @param swkbd Pointer to swkbd state.
258  * @param text Initial text.
259  */
260 void swkbdSetInitialText(SwkbdState* swkbd, const char* text);
261 
262 /**
263  * @brief Configures a word in a predictive dictionary for use with a software keyboard.
264  * @param word Pointer to dictionary word structure.
265  * @param 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.
266  * @param text Spelling of the word, that is, the actual characters that will be produced when the user decides to select the word.
267  */
268 void swkbdSetDictWord(SwkbdDictWord* word, const char* reading, const char* text);
269 
270 /**
271  * @brief Sets the custom word dictionary to be used with the predictive input system of a software keyboard.
272  * @param swkbd Pointer to swkbd state.
273  * @param dict Pointer to dictionary words.
274  * @param wordCount Number of words in the dictionary.
275  */
276 void swkbdSetDictionary(SwkbdState* swkbd, const SwkbdDictWord* dict, int wordCount);
277 
278 /**
279  * @brief Configures software keyboard internal status management.
280  * @param swkbd Pointer to swkbd state.
281  * @param data Pointer to internal status structure (can be in, out or both depending on the other parameters).
282  * @param in Specifies whether the data should be read from the structure when the keyboard is launched.
283  * @param out Specifies whether the data should be written to the structure when the keyboard is closed.
284  */
285 void swkbdSetStatusData(SwkbdState* swkbd, SwkbdStatusData* data, bool in, bool out);
286 
287 /**
288  * @brief Configures software keyboard predictive input learning data management.
289  * @param swkbd Pointer to swkbd state.
290  * @param data Pointer to learning data structure (can be in, out or both depending on the other parameters).
291  * @param in Specifies whether the data should be read from the structure when the keyboard is launched.
292  * @param out Specifies whether the data should be written to the structure when the keyboard is closed.
293  */
294 void swkbdSetLearningData(SwkbdState* swkbd, SwkbdLearningData* data, bool in, bool out);
295 
296 /**
297  * @brief Configures a custom function to be used to check the validity of input when it is submitted in a software keyboard.
298  * @param swkbd Pointer to swkbd state.
299  * @param callback Filter callback function.
300  * @param user Custom data to be passed to the callback function.
301  */
302 void swkbdSetFilterCallback(SwkbdState* swkbd, SwkbdCallbackFn callback, void* user);
303 
304 /**
305  * @brief Launches a software keyboard in order to input text.
306  * @param swkbd Pointer to swkbd state.
307  * @param buf Pointer to output buffer which will hold the inputted text.
308  * @param bufsize Maximum number of UTF-8 code units that the buffer can hold (including null terminator).
309  * @return The identifier of the dialog button that was pressed, or SWKBD_BUTTON_NONE if a different condition was triggered - in that case use swkbdGetResult to check the condition.
310  */
311 SwkbdButton swkbdInputText(SwkbdState* swkbd, char* buf, size_t bufsize);
312 
313 /**
314  * @brief Retrieves the result condition of a software keyboard after it has been used.
315  * @param swkbd Pointer to swkbd state.
316  * @return The result value.
317  */
318 static inline SwkbdResult swkbdGetResult(SwkbdState* swkbd)
319 {
320  return swkbd->result;
321 }
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
Internal libctru book-keeping structure for software keyboards.
Definition: swkbd.h:130
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
Various system types.
#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