How to set lv_btnmatrix style in a little oled like 160*160

Important: posts that do not use this template will be ignored or closed.

I have an oled 160*160, default style for keypad work error.

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

linux fb

What LVGL version are you using?

V7

Screenshot and/or video

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

I believe inner padding on LV_BTNMATRIX_PART_BG controls the space between the buttons.

thank you. every thing is ok now.

image

code is here , and I hve change default_kb_ctrl_lc_map for “ABC” to LV_KEYBOARD_CTRL_BTN_FLAGS | 7

    lv_obj_set_style_local_pad_inner(kb1, LV_BTNMATRIX_PART_BG, LV_STATE_DEFAULT, 0);
    lv_obj_set_style_local_border_width(kb1, LV_BTNMATRIX_PART_BG, LV_STATE_DEFAULT, 0);
    lv_obj_set_style_local_border_width(kb1, LV_BTNMATRIX_PART_BTN, LV_STATE_DEFAULT, 0);


static const lv_btnmatrix_ctrl_t default_kb_ctrl_lc_map[] = {
    LV_KEYBOARD_CTRL_BTN_FLAGS | 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 7,
    LV_KEYBOARD_CTRL_BTN_FLAGS | 7, 3, 3, 3, 3, 3, 3, 3, 3, 3, 6,
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    LV_KEYBOARD_CTRL_BTN_FLAGS | 2, 2, 6, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 2
};

1 Like