Uneven button size for keyboard map


when i try to set new keyboard map for keybaord i seen irregular button size
the first 1,2,3 numbers are perfectly fit to horizontal width.
how to resolve this issue

What MCU/Processor/Board and compiler are you using?


What LVGL version are you using?


What do you want to achieve?

What have you tried so far?

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

//Custom map
    static const char * kb_map[] = {
                  "1","2", "3","\n",
                  "4", "5", "6","\n",
                  "7", "8", "9","\n",
                  " ","0"," ", LV_SYMBOL_BACKSPACE
    keyboard = lv_keyboard_create(lv_scr_act(), NULL);
    lv_keyboard_set_textarea(keyboard, passcode);
    lv_keyboard_set_mode(keyboard, LV_KEYBOARD_MODE_NUM);
    lv_keyboard_set_map(keyboard, LV_KEYBOARD_MODE_NUM, kb_map);
    lv_keyboard_set_cursor_manage(keyboard, true);
    lv_obj_align(keyboard, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, 0);

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

You should also set lv_btnmatrix_ctrl_t kb_ctrl_map[] at the same time regardly, you’ll figure it out. Check lv_keyboard.c for examples.

1 Like

Added lv_btnmatrix_ctrl_t kb_ctrl_map[] to keyboard. now 4 and 8 digits are missing.