lv_keyboard.h¶
Defines
-
LV_KEYBOARD_CTRL_BUTTON_FLAGS¶
Enums
-
enum lv_keyboard_mode_t¶
Current keyboard mode.
Values:
-
enumerator LV_KEYBOARD_MODE_TEXT_LOWER¶
-
enumerator LV_KEYBOARD_MODE_TEXT_UPPER¶
-
enumerator LV_KEYBOARD_MODE_SPECIAL¶
-
enumerator LV_KEYBOARD_MODE_NUMBER¶
-
enumerator LV_KEYBOARD_MODE_USER_1¶
-
enumerator LV_KEYBOARD_MODE_USER_2¶
-
enumerator LV_KEYBOARD_MODE_USER_3¶
-
enumerator LV_KEYBOARD_MODE_USER_4¶
-
enumerator LV_KEYBOARD_MODE_TEXT_ARABIC¶
-
enumerator LV_KEYBOARD_MODE_TEXT_LOWER¶
Functions
-
lv_obj_t *lv_keyboard_create(lv_obj_t *parent)¶
Create a Keyboard object
- Parameters:
parent – pointer to an object, it will be the parent of the new keyboard
- Returns:
pointer to the created keyboard object
-
void lv_keyboard_set_textarea(lv_obj_t *kb, lv_obj_t *ta)¶
Assign a text area to the keyboard. Pressed characters will be inserted there.
- Parameters:
kb – pointer to a keyboard object
ta – pointer to a text area object to write into
-
void lv_keyboard_set_mode(lv_obj_t *kb, lv_keyboard_mode_t mode)¶
Set a new mode (e.g., text, number, special characters).
- Parameters:
kb – pointer to a keyboard object
mode – the desired mode (see 'lv_keyboard_mode_t')
-
void lv_keyboard_set_popovers(lv_obj_t *kb, bool en)¶
Enable or disable popovers showing button titles on press.
- Parameters:
kb – pointer to a keyboard object
en – true to enable popovers; false to disable
-
void lv_keyboard_set_map(lv_obj_t *kb, lv_keyboard_mode_t mode, const char *const map[], const lv_buttonmatrix_ctrl_t ctrl_map[])¶
Set a custom button map for the keyboard.
- Parameters:
kb – pointer to a keyboard object
mode – the mode to assign the new map to (see 'lv_keyboard_mode_t')
map – pointer to a string array describing the button map see 'lv_buttonmatrix_set_map()' for more details
ctrl_map – pointer to the control map. See 'lv_buttonmatrix_set_ctrl_map()'
-
lv_obj_t *lv_keyboard_get_textarea(const lv_obj_t *kb)¶
Get the text area currently assigned to the keyboard.
- Parameters:
kb – pointer to a keyboard object
- Returns:
pointer to the assigned text area object
-
lv_keyboard_mode_t lv_keyboard_get_mode(const lv_obj_t *kb)¶
Get the current mode of the keyboard.
- Parameters:
kb – pointer to a keyboard object
- Returns:
the current mode (see 'lv_keyboard_mode_t')
-
bool lv_keyboard_get_popovers(const lv_obj_t *obj)¶
Check whether popovers are enabled on the keyboard.
- Parameters:
obj – pointer to a keyboard object
- Returns:
true if popovers are enabled; false otherwise
-
const char *const *lv_keyboard_get_map_array(const lv_obj_t *kb)¶
Get the current button map of the keyboard.
- Parameters:
kb – pointer to a keyboard object
- Returns:
pointer to the map array
-
uint32_t lv_keyboard_get_selected_button(const lv_obj_t *obj)¶
Get the index of the last selected button (pressed, released, focused, etc.). Useful in the
event_cb
to retrieve button text or properties.- Parameters:
obj – pointer to a keyboard object
- Returns:
index of the last interacted button returns LV_BUTTONMATRIX_BUTTON_NONE if not set
-
const char *lv_keyboard_get_button_text(const lv_obj_t *obj, uint32_t btn_id)¶
Get the text of a button by index.
- Parameters:
obj – pointer to a keyboard object
btn_id – index of the button (excluding newline characters)
- Returns:
pointer to the text of the button
-
void lv_keyboard_def_event_cb(lv_event_t *e)¶
Default keyboard event callback to handle button presses. Adds characters to the text area and switches map if needed. If a custom
event_cb
is used, this function can be called within it.- Parameters:
e – the triggering event
Variables
-
const lv_obj_class_t lv_keyboard_class¶