Utility Button - Time Elapse Function

Hi guys,

Is there chance to have the button_elapse_time function also for the Utility Button? I do use it a lot and would be very useful to program single /double click actions.

I can create it using the timer but would be a waste of code characters having that function already for buttons, what do you think?

Here a example I use for normal button:

-- On Button
if self:button_state() > 0 then
    local ET = 100
    if self:button_elapsed_time() < ET then
        print("secondary function")
    else
        print("primary function")
    end
end

Thank you in advance!

1 Like

As far as I know it’s not implemented!

For now the timer would be the solution in this use-case. I would also recommend you make a feature request about this on our firmware repository on Github. That way you can track what’s happening to the request as our FW devs get to it.

2 Likes

Awesome, thanks @narayb !

I’ve just posted it on github too. :+1:

1 Like