Make `lv_indev_wait_release` optional for Gesture Events

Hello SquareLine Studio Team,

I have a feature request to make the lv_indev_wait_release function optional when using gesture events in SquareLine Studio.

Context

Currently, when you add a gesture event to an object in SquareLine Studio and export the code, it automatically includes lv_indev_wait_release(lv_indev_get_act()); in the event handler.
This feature is helpful in preventing accidental click events immediately following a gesture event (as discussed in this Github thread).

For example, this is code that SquareLine Studio currently generates for gesture events:

void ui_event_example(lv_event_t * e)
{
    lv_event_code_t event_code = lv_event_get_code(e);

    if(event_code == LV_EVENT_GESTURE &&  lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_BOTTOM) {
        lv_indev_wait_release(lv_indev_get_act());
        ExampleFunction(e);
    }
}

(SquareLine Studio version: 1.5.0 - LVGL version: 8.3.11)

What do you want to achieve?

I have run into an Issue with this, as I now have no option to still receive the touch events. I have a use case where I need different behavior depending on whether the user immediately releases the display or keeps holding it after a gesture.
But with this safety feature this is not possible.

Do you see alternative options and workaround to achieve it?

My current workaround is to have a script automatically comment out the lv_indev_wait_release(lv_indev_get_act()); lines in my exported code but this is obviously not a good solution.

Requested feature

What I would like to see included in SquareLine is an option to disable this safety feature on a per-event basis.

Something along the lines of this:

Thank you for considering this feature!

Hi, thanks for your feature request! We’ll review how we can best solve this gesture event issue.

1 Like