I’m using an encoder and my goal is to have an object, in this case, a switch as a child, but when moving my encoder I want to “focus” the parent, skip the child object, and go to the next.
I’m not sure if this is relevant, but the parent button is also a child of a grid layout
What LVGL version are you using?
v8.3
What do you want to achieve?
Have some objects as not “focusable” by the encoder
I was able to reduce this to just screen creation and adding a switch/buttons to the screen, and as you can see, turning the knob (thus inputting NEXT) can highlight the button that is set to not be clickable.
I thought about it, and it does work, however, it doesn’t seem like the correct solution to the problem. At this point, I would like to understand if this is expected behavior or not.
The encoder focuses the widget only from the group which is assigned to the input device. And widgets are automatically added the default group if it’s set.
I suggest searching for lv_group_set_default() to find where it is set and created.
It took me a minute to understand that part but I understood the group idea, and I’m currently setting a group for each independent screen, to simplify things, while that screen is in focus, the focused screen group is the default group. So all objects created while the screen is up, belong to the ‘current default group’.
I think my question is a bit different. I would like to know if is possible to create an object, and set it to as not ‘selectable’ by the encoder;
The result would be similar to having an Object that belongs to a group that does not receive any input or doesn’t belong to a group at all.
However, it seems to me that I should be able to archive this without having to resort to a special group or group less object workaround; clearing the LV_OBJ_FLAG_CLICK_FOCUSABLE should, IMO, make this object unfocusable by the encode (in the same way a label isn’t).
Do you think this is a valid expectation or is there an implication that I’m not seeing?