Get caret position from text input

Hi, thanks, but I checked that we are using Perspective not Vision.
I am trying to call it at Text Input. We built alphanumeric keyboard as a component so we dont use the tablet mode keyboard on touchscreen. So I dont know if its possible but it would be great work it like that, Text input is focused - touch of the button (lets say key A) and it checks caretp position and adds a key. I am afraid that when I touch the button, the focus is lost from Text input so the caret position would not work, am I wrong ? Or it is saving its position somewhere or I should use the approach you have given with saved caret position as custom property