Using the Button input device

Addon to the previous message

Here are the printouts of a sample run of the script with one (short) button press. I changed the prints in order for them to be more informative:

With a button indev:

import lvButtons
ILI9341 initialization completed
Enable backlight
Single buffer
State change [Pin(39)] False->True
Button read [<BoutonPhy object at 3f819df0>] (struct lv_indev_drv_t) state: 1, id:1
State change [Pin(39)] True->False
Button read [<BoutonPhy object at 3f819df0>] (struct lv_indev_drv_t) state: 0, id:1

Notice that there is no call to the event handler.

With an Ecoder indev:

import lvButtons
ILI9341 initialization completed
Enable backlight
Single buffer
Event handler [lvgl btn] event: 12
State change [Pin(39)] False->True
Button read [<BoutonPhy object at 3f819df0>] struct lv_indev_drv_t state: 1, id:1
Event handler [lvgl btn] event: 0
State change [Pin(39)] True->False
Button read [<BoutonPhy object at 3f819df0>] struct lv_indev_drv_t state: 0, id:1
Event handler [lvgl btn] event: 3
Event handler [lvgl btn] event: 6
Event handler [lvgl btn] event: 7

Here I have what I wanted: a button that is pressed, then released shortly after. Thus a presse (event 0) that is a short click (events 3, 6) followed by a release (event 7)…

What I don’t want (and cannot avoid with an encoder group) is the focused event and the focus ring around the logical button.