Description
Defining multiple groups prevent keypad navigation
What MCU/Processor/Board and compiler are you using?
ESP32
What LVGL version are you using?
8.3.9
What do you want to achieve?
I tried to define different groups, each with individual sets of objects (buttons) added to them. These groups should then later beeing interactively assigned to an input device.
What have you tried so far?
I started with a simple project generated in Squareline 1.3.2:
there are in sum 6 buttons (two panels with 3 buttons).
In the ui.h I defined 3 groups as global constants:
extern lv_group_t *groupA;
extern lv_group_t *groupB;
extern lv_group_t *groupC;
The groups are initialized by adding those lines to the top of the ui_Screen1.c. Additionally, all objectes created subsequently are added to the groupA:
void ui_Screen1_screen_init(void)
{
groupA = lv_group_create();
groupB = lv_group_create();
groupC = lv_group_create();
lv_group_set_default(groupA);
...
created objects
}
So far, this works fine. The navigation with the keypad is possible.
But if I try to define for example groupB at the end of the function above (when all objects have been created), by adding
void ui_Screen1_screen_init(void)
{
groupA = lv_group_create();
groupB = lv_group_create();
groupC = lv_group_create();
lv_group_set_default(groupA);
...
created objects
...
lv_group_add_obj(groupB, ui_Button1);
lv_group_add_obj(groupB, ui_Button2);
etc.
}
the navigation with the keypad wont work anymore, and for me its no obvious why this is the case. There is no re assignment of the input-driver, its just a simple definition of the groups.
I created this simple program with only 6 buttons after I ran into trouble with a more complex program. The global variables and groups in this program are placed in a different location, so wrode the test programm with the groups defined more close after the creation of the objects.
Best regards
GeorgS