How to use keypad device in lvgl 9.0?

Recently I update my lvgl version from v8.3 to v9.0, but the way to use input device seems been changed, there is no lv_indev_drv_t. I looked up the documentation, source code of lv_indev.h and lv_indev.c. Them I tried to implement it through the ways below:

Declare the device variable in gui.h:

static lv_indev_t *indev_keypad = { NULL }; // input device

Create it in gui.c:

static void DeviceInit()
    indev_keypad = lv_indev_create();
    lv_indev_set_type(indev_keypad, LV_INDEV_TYPE_KEYPAD);

In another function B, I create a group, a virtual keypad(ta is a textarea, used to accept character):

static void B()
    lv_group_t *g = lv_group_create();              // create a group
    lv_obj_t *kb = lv_keyboard_create(bg_mask);     // create a virtual keypad
    KeypadSetting(g, kb, ta);

In function KeypadSetting()

static void KeypadSetting(lv_group_t *g, lv_obj_t *kb, lv_obj_t *ta)
    lv_group_add_obj(g, kb);
    lv_group_add_obj(g, ta);
    lv_indev_set_group(indev_keypad, g);

    lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2);
    lv_keyboard_set_textarea(kb, ta);   // Focus the virtual keyboard on the input box


I dont’ konw wether it is right. If I delete the line lv_indev_read(indev_keypad);, the procedure will run as normal, but the textarea can not receive character. If I add lv_indev_read(indev_keypad); it will crash.
I use Debugger to check where is the probelm, it finally go to the function in lv_indev.c:

static bool indev_reset_check(lv_indev_t * indev)
    if(indev->reset_query) {
        indev_obj_act = NULL;

    return indev->reset_query;

The probelem is that the indev is NULL so taht it crash.
Thank you for seeing this. I’m posting this question to seek solution, or another way to let the textarea can receive the character from my real keypad.