How to input through the up and down keys on the keyboard to make the roller scroll infinitely?

Currently, the roller control is used on LVGL8.3.7, but the input method is to control the roller to scroll up and down through physical buttons.
But the roller is set to LV_ ROLLER_ MODE_ After INFINITE, when the index is 0, how to scroll up and select the last index.
It is how to achieve an effect similar to touch input, truly achieving infinite scrolling whether up or down.

I mean index is irelevant. You need send events KEY UP DOWN to object instead positions.

First of all, thank you for your reply.
I use send events KEY UP DOWN to execute functions (lv_roller_set_selected) to achieve roller scrolling.
Do I need any configuration to follow what you said? What settings are needed after adding objects to the group? I tried both the navigation mode and editing mode, but there was no response.

Show your code… execute function ???

Sure, could you please help me take a look.

The code implementation is as follows:

static void av_page_event_cb(lv_event_t *e)
    uint8_t roller_index;

    lv_event_code_t code = lv_event_get_code(e);
    lv_obj_t *obj = lv_event_get_target(e);

    if (LV_EVENT_KEY == code) {
        uint32_t key = lv_event_get_key(e);
        roller_index = lv_roller_get_selected(av_page_roller);
        if(LV_KEY_DOWN == key){
            if(roller_index < lv_roller_get_option_cnt(av_page_roller)){

        else if(LV_KEY_UP == key){

        av_page_roller = lv_roller_create(av_page);
        lv_obj_add_style(av_page_roller, &style, 0);
        lv_obj_set_style_text_line_space(av_page_roller, 25, LV_PART_MAIN);
        lv_obj_set_style_bg_opa(av_page_roller, LV_OPA_TRANSP, LV_PART_SELECTED);

        lv_obj_set_style_text_color(av_page_roller,lv_color_white(), LV_PART_SELECTED);


        lv_obj_align(av_page_roller, LV_ALIGN_CENTER, 0, 0);
        lv_roller_set_visible_row_count(av_page_roller, 3);
        lv_obj_remove_style(av_page_roller, NULL, LV_STATE_FOCUS_KEY);
        lv_obj_remove_style(av_page_roller, NULL, LV_STATE_EDITED);

        lv_obj_add_event_cb(av_page, av_page_event_cb, LV_EVENT_KEY, NULL);
        lv_group_add_obj(lv_group_get_default(), av_page);
        lv_group_set_editing(lv_group_get_default(), true);

Your showed callback is maybe not required. All controls is now in lvgl code, you only need right indev management.

I think the same thing, but without any callback, there was no response.
The object I am adding to the group now is the entire page. Later, I will try adding only the roller to the group to see how it works.

Check roller source lvgl/src/widgets/lv_roller.c at v8.3.7 · lvgl/lvgl · GitHub and search

else if(code == LV_EVENT_KEY)