How set mouse cursor

I’m trying to add a mouse cursor. There is the following code

import lvgl as lv

img = lv.img(lv.scr_act(), None)
img.set_src(lv.SYMBOL.OK)
lv.indev_t.set_cursor(lv.indev_t(), img)

The cursor appears on the screen, but does not move. In this case, the buttons on my form react to the invisible cursor clicks.

How do I make a real cursor to work? How to do it correctly? What should be substituted in the first argument “lv.indev_t.set_cursor”?

For v8 (try it!):

img = lv.img(lv.scr_act())
img.set_src(lv.SYMBOL.OK)
lv.indev_t.get_next(None).set_cursor(img)

For v7 (try it!):

img = lv.img(lv.scr_act(), None)
img.set_src(lv.SYMBOL.OK)
lv.indev_t.get_next(None).set_cursor(img)
1 Like