Description
Hello community, I am working on a custom board based on the iMX RT1052 processor, using the GCC compiler within the MCUXpresso IDE. I am utilizing LVGL version 8.3 for the graphical user interface.
My goal is to use an encoder to navigate through an array of checkboxes. Specifically, I need to disable the default navigation/edit mode function because I want to navigate through the checkboxes using the encoder’s rotation and check or uncheck the checkboxes with a button press.
Can someone help me to achieve this goal?
What MCU/Processor/Board and compiler are you using?
Custom board based on iMX RT1052, GCC (MCUXpresso)
What LVGL version are you using?
LVGL v8.3
What do you want to achieve?
I need to use an encoder to navigate through an array of checkboxes. I need to disable the navigation/edit mode function because I want to move through the checkboxes using the rotation of the encoder and check or uncheck the checkboxes with a button press.
What have you tried so far?
I tried to use:
lv_group_set_editing(lv_group_get_default(), false);
But the behavior is strange; clicking checks some checkboxes with encoder rotation but not with a click.
Code to reproduce
I created checkboxes with code like this:
// Create an array to hold checkboxes
lv_obj_t * checkboxes[NUM_CHECKBOXES];
// Create checkboxes and configure them
for (int i = 0; i < NUM_CHECKBOXES; i++) {
checkboxes[i] = lv_checkbox_create(lv_scr_act()); // Create checkbox on the active screen
// Set event handler
lv_obj_add_event_cb(checkboxes[i], checkbox_event_handler, LV_EVENT_ALL, NULL);
// Align the checkbox (optional)
lv_obj_align(checkboxes[i], LV_ALIGN_TOP_LEFT, 10, 10 + i * 30); // Adjust alignment and spacing as needed
}
Thank you so much.