An on-screen keyboard for a short name: capitals, digits, space and the marks a name or a file needs, "-", "_" and ".".
More...
|
|
#define | UI_TEXTKEY_MAX 23 |
| | The longest name or search it takes, in characters.
|
|
#define | UI_TEXTKEY_PASS_MAX 63 |
| | The longest Wi-Fi password, in characters.
|
|
#define | UI_TEXTKEY_PASS_MIN 8 |
| | The shortest Wi-Fi password, in characters.
|
|
#define | UI_TEXTKEY_SSID_MAX 32 |
| | The longest Wi-Fi network name, in bytes.
|
|
#define | UI_TEXTKEY_CHARS 40 |
| | The keys: forty characters in four rows of ten, then SPACE, CLR, CANCEL and OK along the bottom.
|
|
#define | UI_TK_SHOW UI_TK_KEYS |
| | SHOW, the password keyboard's sixth bottom key; zero size otherwise.
|
|
#define | UI_TK_SHIFT 30 |
| | The Wi-Fi keyboard's capitals key, left of Z.
|
|
#define | UI_TK_LAYER 38 |
| | The Wi-Fi keyboard's marks key, left of DEL.
|
|
#define | UI_TK_DEL (UI_TEXTKEY_CHARS - 1) |
| | The DEL key, last of the character rows.
|
|
#define | UI_TK_MARK (UI_TEXTKEY_CHARS - 3) |
| | The key that types "_", or "*" in a search.
|
|
#define | UI_TK_DOT (UI_TEXTKEY_CHARS - 2) |
| | The key that types ".", or "/" for a folder.
|
|
| void | ui_textkey_open (ui_textkey_t *k, gfx_rect_t area, const char *title, const char *text, int max_len) |
| | Open over area on text.
|
| void | ui_textkey_open_search (ui_textkey_t *k, gfx_rect_t area, const char *title, const char *text, int max_len) |
| | Open for a search pattern; see the top of this file.
|
| void | ui_textkey_open_folder (ui_textkey_t *k, gfx_rect_t area, const char *title, const char *text) |
| | Open for a folder of the card; see the top of this file. Up to UI_TEXTKEY_MAX characters.
|
| void | ui_textkey_open_wifi (ui_textkey_t *k, gfx_rect_t area, const char *title, const char *text, bool secret) |
| | Open for a Wi-Fi password or network name; see the top of this file. Lower case first.
|
| void | ui_textkey_open_file (ui_textkey_t *k, gfx_rect_t area, const char *title, const char *text) |
| | Open for a file name; see the top of this file. Lower case first.
|
| void | ui_textkey_close (ui_textkey_t *k) |
| | Close, dropping a press under way.
|
| void | ui_textkey_cancel_press (ui_textkey_t *k) |
| | A press under way is dropped: the touch stream lost an event. What was typed stays typed.
|
| ui_textkey_result_t | ui_textkey_event (ui_textkey_t *k, const touch_event_t *evt, char *out, size_t n) |
| | One touch event.
|
| gfx_rect_t | ui_textkey_key_rect (const ui_textkey_t *k, int key) |
| | Where a key is drawn and hit: the grid ends 8px inside the area, or at UI_KEYS_FOOT (4px above the alert band, body coordinates) where the area reaches further.
|
| const char * | ui_textkey_label (int key) |
| | A key's label as a name keyboard shows it.
|
| const char * | ui_textkey_key_label (const ui_textkey_t *k, int key) |
| | A key's label as k shows it.
|
| const gfx_font_t * | ui_textkey_char_font (const ui_textkey_t *k) |
| | The face of the character keys: the largest of 20 x 36, 16 x 28, 12 x 24 and 10 x 20 whose cell fits a character key with 4px on each side, else 8 x 16. Over the WI-FI screen's 1008 x 484px a key is 93 x 71px and takes 20 x 36.
|
| const gfx_font_t * | ui_textkey_word_font (const ui_textkey_t *k) |
| | The face of the word keys (the bottom row, DEL, and the Wi-Fi layer keys) in the language shown: the largest of 20 x 36, 16 x 28, 12 x 24 and 10 x 20, never larger than ui_textkey_char_font(), in which every one of them fits its key with 4px each side, in every state it can show (SHOW and HIDE, ABC, abc and #+=), so the words of one keyboard share one face and a press does not change it; else 8 x 16.
|
| void | ui_textkey_render (const ui_textkey_t *k, gfx_canvas_t *c) |
| | The whole keyboard over its area: the title and the count in 10 x 20 (8 x 16 where they do not fit side by side), the text in 20 x 36 (16 x 28 in a field narrower than UI_TEXTKEY_MAX characters and the caret), the character keys in ui_textkey_char_font() and the word keys in ui_textkey_word_font(). Nothing while it is closed.
|
An on-screen keyboard for a short name: capitals, digits, space and the marks a name or a file needs, "-", "_" and ".".
Unlike the numeric keypad it edits the text it was opened with: DEL takes the last character, CLR the lot. OK on an empty name is refused, because a name is what a report is filed under. Spaces at either end are dropped on OK.
Opened for a search (ui_textkey_open_search()) it types a search pattern instead: the "_" key types "*", the wildcard; OK takes the text as typed, empty included, since an empty search is no search; and the bottom row gives SPACE and CANCEL three columns each, CLR and OK two, so CANCEL's longer translations fit an area narrower than the SERVO screen's. The caller reads the text as it is typed from text.
Opened for a folder of the card (ui_textkey_open_folder()) it types a path such as BENCH/LOGS: the "." key shows and types "/", and OK takes the path only when card_folder_check() (card_tree.h) does, in upper case. A refused OK keeps the keyboard open, and its line says why: an empty folder, over 8 characters, over 2 folders deep, a character outside A-Z, 0-9, "_" and "-", a reserved name, a folder of the bench's own files. The keys and the rest of the layout are the name's.
Opened for Wi-Fi (ui_textkey_open_wifi()) it types a network name of up to 32 bytes or a password of 8 to 63 characters: any printable ASCII (American Standard Code for Information Interchange) character, lower case included. Three layers share the grid: lower case, capitals, and the 32 marks. The key left of Z switches lower case and capitals ("ABC", "abc"); the key left of DEL switches to the marks and back ("#+=", "abc"). The digits stay on the top row of both letter layers. A password shows as "*" until SHOW, which a sixth bottom key carries (UI_TK_SHOW); SHOW again hides it. OK takes the text as typed, spaces included, and refuses a password under 8 characters or an empty name. A text longer than the field shows its end.
Opened for a file name (ui_textkey_open_file()) it is the Wi-Fi keyboard with its three layers, for a name of up to FM_NAME_MAX (59) bytes: OK takes the name only when fm_name_check() (fm_name.h) does, as typed. A refused OK keeps the keyboard open, and its line says why: an empty name, over 59 bytes, one of " * / : < > ? \ | , a space or a full stop at an end, a device name. DEL takes the last character, also one of two bytes.
The screen routes events to it while it is open and draws it last, as it does the keypad.
SPDX-License-Identifier: MIT