What do you want to achieve?
For example i need roll roller up down with encoder, or change text value …
What have you tried so far?
Added dev and
void my_usbenc_read( lv_indev_drv_t * indev_driver, lv_indev_data_t * data )
{
data->enc_diff = 0; //enc_get_new_moves();
if ( mouse_report && mouse_report->y_displacement ){
data->enc_diff = mouse_report->y_displacement;
mouse_report->y_displacement = 0;
}
data->state = LV_INDEV_STATE_REL;
}
Screenshot or video
roller is controlleble with primary indev touchscreen but dont react to enc
Others
**SquareLine Studio version:1.1.1
Operating system:
**Target hardware:ESP32S3
Solved
//Create Group for encoder
g1 = lv_group_create();
lv_indev_set_group(encoder_indev, g1);
ui_init();
lv_group_add_obj(g1, ui_Screen3_Roller1);
lv_group_set_wrap(g1, true);
lv_group_set_editing(g1, true);
1 Like
Do you have a GitHub repo or something? Would like to learn the details of how you implemented.
Sorry no , try ask what you need.
New question.
Now Roller is controlled by two indevs touch and encoder, but if touch is used
object is switched from EDITED to FOCUS and encoder stop working,
Howto best way to handle this ???
SOLVED with
lv_group_focus_freeze(g1, true);
If I have multiple buttons, every button is for a specific group only. What should the button callback function like?
If you mean indev hardware button type, this i mean dont require group. Instead it simulate touch on x,y position.
I don’t really understand the question. Could you show an example?
I used the 3D printer demo as an example. How do I control the UI with rotary encoder?
My driver could read the diff by rotary encoder. But the UI does not react.
Others
SquareLine Studio version: 1.2.1
Operating system: Windows 11
Target hardware: ESP32-S3
Marian_M:
lv_group_add_obj
Use it for all or one widget you plan encoder control and assign group to indev.
After this ecoder moves focus between objects and push switch to edit mode actual focus.