Adding keyboard to print demo

Description

Hi, I tried to add lv_keyboard_create() to print demo and followed the website doc, but for some reason the keyboard doesn’t look like the one in demo widget and the cursor is not being shown in the text area.

What do you want to achieve?

The same keyboard that is in demo widget

What have you tried so far?

Keyboard (lv_keyboard) — LVGL documentation and the demo widget code.

Code to reproduce

/**********************
 *  STATIC VARIABLES
 **********************/
static lv_obj_t* kb;
static lv_obj_t* ta;

/*Functions kb_event_cb, kb_create,ta_event_cb are used to create keyboard for text areas and close and open the keyboard */

static void kb_event_cb(lv_obj_t* keyboard, lv_event_t e)
{
    lv_keyboard_def_event_cb(kb, e);
    if (e == LV_EVENT_CANCEL) {
        lv_keyboard_set_textarea(kb, NULL);
        lv_obj_del(kb);
        kb = NULL;
    }
}

static void kb_create(void)
{
    lv_coord_t kb_height = LV_MATH_MIN(LV_VER_RES / 2, LV_DPI * 4 / 3);
    kb = lv_keyboard_create(lv_scr_act(), NULL);
    lv_obj_set_height(kb, kb_height);
    lv_obj_align(kb, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
    lv_keyboard_set_cursor_manage(kb, true);
    lv_obj_set_event_cb(kb, kb_event_cb);
    lv_keyboard_set_textarea(kb, ta);

}

static void ta_event_cb(lv_obj_t* ta, lv_event_t e)
{
    if (e == LV_EVENT_CLICKED && kb == NULL) {
        kb_create();
    }
}

static void message_open()
{
/*
    lv_obj_t* back = add_back(back_to_options_event_cb);
    lv_demo_printer_anim_in(back, delay);
    if (back) {
        kb = NULL ;
    }*/

    lv_coord_t box_w = 720;

    lv_obj_t* h = lv_cont_create(lv_scr_act(), NULL);
    lv_obj_set_size(h, box_w, 250);
    lv_obj_align(h, NULL, LV_ALIGN_IN_TOP_MID, 0, 130);
    lv_cont_set_layout(h, LV_LAYOUT_PRETTY_MID);
    lv_obj_add_style(h, LV_CONT_PART_MAIN, &style_box);
    lv_obj_set_drag_parent(h, true);

    ta = lv_textarea_create(h, NULL);
    lv_obj_set_size(ta, 200, 100);
    lv_obj_align(ta, NULL, LV_ALIGN_IN_LEFT_MID, 0, 130);
    lv_cont_set_fit2(ta, LV_FIT_PARENT, LV_FIT_NONE);
    lv_textarea_set_text(ta, "");
    lv_textarea_set_placeholder_text(ta, "Message");
    lv_textarea_set_cursor_click_pos(ta, true);
    lv_obj_add_state(ta, LV_STATE_FOCUSED);
    lv_obj_set_event_cb(ta, ta_event_cb);
    lv_cont_set_fit4(ta, LV_FIT_PARENT, LV_FIT_PARENT, LV_FIT_NONE, LV_FIT_PARENT);



    delay += LV_DEMO_PRINTER_ANIM_DELAY;
    lv_demo_printer_anim_in(box, delay);

    lv_demo_printer_anim_bg(0, LV_DEMO_PRINTER_BLUE, LV_DEMO_PRINTER_BG_NORMAL);
}

Screenshot and/or video

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

Demo widget keyboard