|
Swadge ESP32-S2
APIs to develop for the Magfest Swadge
|
Data Structures | |
| struct | textEntry_t |
| Struct to store all state for a text entry. More... | |
Macros | |
| #define | NUM_KEYBOARD_SYMBOLS ('~' - ' ' + 2) |
| #define | KB_LINES 5 |
| #define | RETURN_WIDTH 16 |
| #define | CORNER_MARGIN 20 |
| #define | SHADOWBOX_MARGIN 4 |
| #define | KEY_SPACING 5 |
| #define | BLINK_RATE 500000 |
Enumerations | |
| enum | controlChar_t { KEY_SHIFT = 0x01 , KEY_CAPS_LOCK = 0x02 , KEY_BACKSPACE = 0x03 , KEY_SPACE = 0x20 , KEY_EOL = 0x05 , KEY_TAB = 0x09 , KEY_ENTER = 0x0A } |
Functions | |
| void | textEntryInit (const textEntrySettings_t *settings, char *entryText, font_t *font) |
| void | textEntryDeinit () |
| Deletes the memory used by the text entry system. | |
| bool | textEntryInput (buttonEvt_t evt) |
| Handle button input for text entry. | |
| bool | textEntryDraw (int64_t elapsedUs) |
| Draws the text entry screen. | |
| void | textEntrySoftReset () |
| Resets the textEntry object. | |
Variables | |
| textEntry_t * | te |
| struct textEntry_t |
| Data Fields | ||
|---|---|---|
| char * | text | |
| font_t * | font | |
| const textEntrySettings_t * | tes | |
| uint8_t | widestChar | |
| int | selX | |
| int | selY | |
| keyModifier_t | kMod | |
| char | selChar | |
| int64_t | blinkTimer | The number of nanoseconds remaining before the blink state changes. |
| bool | blinkState | Boolean value to keep track of whether the blinking cursor is shown. |
| char * | value | The buffer holding the actual entered text value. Can be accessed as a string. |
| uint16_t | size | The total size of the dynamic text buffer. |
| uint16_t | cursor | The position of the cursor. |
| bool | overtype | Whether the cursor will operate in overtype mode instead of insert mode. |
| bool | pendingChar | Whether a to-be-entered character should be shown. |
| char | cur | The current character pending addition at the cursor, when pendingChar is true. |
| uint16_t | minLength | The minimum length of text that will be accepted. |
| uint16_t | maxLength | The maximum length of text allowed, or 0 for no limit. |
| textEntryCharMask_t | mask | The mask of character types that are allowed. |
| touchSpinState_t | spinState | Struct to track the state of the touchpad for spins. |
| char | spinCharStart | The selected character at the start of the touchpad spin. |
| buttonBit_t | heldButton | The button that is currently being held, or 0 if none. |
| int64_t | repeatTimer | The number of nanoseconds remaining before the held button repeats. |
| uint16_t | offset | The first character to be drawn on-screen, if the whole value doesn't fit. |
| uint16_t | x | The X position of the text entry box. |
| uint16_t | y | The Y position of the text entry box. |
| uint16_t | w | The width of the text entry box. |
| const font_t * | font | The font to use for text entry. |
| void * | data | A pointer to be passed back into the callback. |
| textEntryCb | cbFn | The function to call when the text entry is completed. |
| #define NUM_KEYBOARD_SYMBOLS ('~' - ' ' + 2) |
| #define KB_LINES 5 |
| #define RETURN_WIDTH 16 |
| #define CORNER_MARGIN 20 |
| #define SHADOWBOX_MARGIN 4 |
| #define KEY_SPACING 5 |
| #define BLINK_RATE 500000 |
| enum controlChar_t |
| void textEntryInit | ( | const textEntrySettings_t * | settings, |
| char * | entryText, | ||
| font_t * | font ) |
| void textEntryDeinit | ( | void | ) |
Deletes the memory used by the text entry system.
| bool textEntryInput | ( | buttonEvt_t | evt | ) |
Handle button input for text entry.
| evt | button event to run |
| bool textEntryDraw | ( | int64_t | elapsedUs | ) |
Draws the text entry screen.
| elapsedUs | TIme for cursor blink |
| void textEntrySoftReset | ( | void | ) |
Resets the textEntry object.
| textEntry_t* te |