LVGL and Button Matrices

Another day, another question about LVGL.

I’m tempted to post this somewhere LVGL-related, but since PROS is stuck on LVGL version 5.3.0 at the moment, I decided to ask here.

I’m trying to use a button matrix in order to have multiple options to choose. The problem is, I don’t have any idea as to how to assign individual tasks to each of the buttons. I checked on the docs and even snooped around in the header files to get a better idea, but I’m still lost. I know this is a pretty simple and silly question, but does anyone have any advice about this?

To differentiate between the buttons, you need to compare their text.
The callback for a button matrix accepts the btnm object, and the text of the pressed button.
Then use string compare functions (either C or C++) or a switch case to branch into a separate action for each button.

1 Like

Okay, I got it now. Thank you.