Description
What MCU/Processor/Board and compiler are you using?
I am using the simulator and the stm32
What LVGL version are you using?
Version 6.1.2
What do you want to achieve?
When i retreive the focused object from a group using *“lv_group_get_focused”, i get an object back. Is there any way to tell what type of object this is? e.g. Is it a button or is it a switch?
What have you tried so far?
At the moment i have kept an array of objects that are in the group. I do a comparison between each object in that array and the object that i retreive from the “lv_group_get_focused” function, I then do a comparison between them all to find which one has focus.
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
/*
//pseudo code of what i am doing
int indexFound=0;
for(int x=0;x<SizeOfObjectArray;x++)
{
if(ObjectArray[x]==lv_group_get_focused(group))
{
indexFound=x;
break;
}
}
//pseudo code of what i would like to be able to do
lv_obj_t* obj = =lv_group_get_focused(group);
switch (obj.type)
{
case(button):
break;
case(switch):
break;
}
*/