How to switch between two groups

Important: unclear posts may not receive useful answers.

Before posting

  • Get familiar with Markdown to format and structure your post
  • Be sure to update lvgl from the latest version from the master branch.
  • Be sure you have checked the FAQ and read the relevant part of the documentation.
  • If applicable use the Simulator to eliminate hardware related issues.

Delete this section if you read and applied the mentioned points.

Description

how to switch between two groups

What MCU/Processor/Board and compiler are you using?

stm32f4

What LVGL version are you using?

v8.1

What do you want to achieve?

to achieve active one group and disable another one,and swap the activity of them

What have you tried so far?

I used the function lv_group_focus_freeze to set them,but the effection isn’t I want

set g2 activety,disactivity g1
lv_group_focus_freeze(g1,true)
lv_group_focus_freeze(g2,false)

set g1 activity,disactivity g2
lv_group_focus_freeze(g1,false)
lv_group_focus_freeze(g2,true)

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:

/*You code here*/

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

Can you use lv_group_remove_all_objs() and add the object again later?

I also encountered a similar problem, I use the V8.3 version, is it necessary to do this? Thanks.

I don’t have a better idea than lv_group_remove_all_objs :slight_smile:

OK,Thanks. :+1:

An input device can send the keys to only one group but, a group can receive data from more than one input device too.

To associate a group with an input device use lv_indev_set_group(indev, g)

You try use this to swith more groups?

I didn’t notice the words “An input device can send the keys to only one group…”, thanks for reminding me, I have solved the problem according to what you said.Thank you. :+1: