I am using LVGL 9.3.0 with Micropython 1.27.0
I have a rotary encoder configured using lv.INDEV_TYPE.ENCODER and this works fine.
I cannot get crown behaviour working using lv.INDEV_TYPE.POINTER.
I am testing with a slider control that has focus.
Documentation for 9.3.0 says set data->diff to the encoder delta, but inspection of the c code shows that there is only data->enc_diff, so I am using this field. In micropython, dir(data) from within read_cb shows only the enc_diff field is present. Is this the problem?
9.3 code seems to be mismatched with docs here: Input Device (lv_indev) - LVGL 9.3 documentation
I have tried many things to get this working:
- I have set indev rotary sensitivity to 256.
- I have read back the slider rotary sensitivity and it is 256.
- I have debug in my code to prove encoder deltas are being read in the pointer read_cb. Anyway, they work fine for encoder mode, just not pointer mode.
- I have an event cb setup for ALL events on the slider. I see many events for prev, next, left, right and enter etc. I see no events when rotating my crown/pointer configured encoder.
- I have tried using two encoders with one configured as encoder and one configured as crown. Clicking the the encoder button allows me to edit. In this state, rotating the crown still does not produce any events or change in the slider position. Again, I see many events on the slider for the encoder that is configured with lv.INDEV_TYPE.ENCODER.
- I am setting the group correctly. Other controls set to the same group are working just fine. In fact this encoder when set to lv.INDEV_TYPE.ENCODER instead of lv.INDEV_TYPE.POINTER also works just fine.
Fundamentally:
- Does 9.3.0 support crown behaviour?
- Does a slider receive ROTARY events?
- Can a slider widget be controlled by a crown wheel?
Code attached. I’m out of ideas. If anyone has a working example of crown wheel behaviour in either c or micropython (that works in 9.3.0), I am sure I could get my code working. 9.3.0 is the newest I can go to at the moment, as this is currently the latest lv_binding_micropython.
test.py (7.4 KB)