Change to spinbox style cursor


I am trying to make an input field for IP address where I’m using a text area. I am using left/right arrow keys to move left and right and up/down to change the numbers. This is working fine. The only thing I’m struggling with now is to change the cursor so that it looks like the cursor in the spinbox. I.e. that the character to the right of the cursor is marked in blue, like that the character is selected. I can’t find anywhere in the spinbox code where the cursor is modified, and it’s starting to make me crazy.

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

I am trying this in windows simulator so far.

What LVGL version are you using?


What do you want to achieve?

A cursor/selection that shows the character left of the cursor in a different colour.

What have you tried so far?

I have tried to basically remove everything in the lv_spinbox.c to make it become a text area, but still the cursor is a “spinbox style cursor”. I believe I am missing something trivial.

I figured it out. The magic happens in lv_theme_default.c, where different styles are added depending on object type. There are some additional styles added to the text area cursor that must be undone. What I maybe will end up with is to add a new type “ipspinbox” and add the same styles as spinbox to that type.