[How to] How to get position of text-selection in the text-area widget?

Description

When the lv_ta with text-selection mode is enable
and a user makes a text-selection by mouse/touching.

How to get the start and the end position of the text-selection?

Thank you.

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

What do you want to achieve?

What have you tried so far?

Code to reproduce

Screenshot and/or video

Use the label functions on the text area’s label. Docs

lv_label_get_text_sel_start(lv_ta_get_label(ta))
lv_label_get_text_sel_end(lv_ta_get_label(ta))
1 Like

Thank you very much.