Start a new topic

Tutorial / Button Events

Every user of an Android Smartphone knows, there is a LongPress action available ...

And sometimes this can became very handy ...


    - get an additional hint ...

    - trigger some additional setup funtions

    - popup additional infos ...

    - ...


Nextion Buttons offer per default an OnClick and an OnRelease event. For most issues it is enough. But it would also be handy, if there is an OnLongPress alike event ...


It can be done very easily, together with a timer object and a counter ...


    - on Press, start the timer ...

    - the timer counts up ...

    - on Release, stop the timer and check the counter ...

    - based on the counter value, do whatever you want ...


Actions can be inside the ButtonRelease event, or directly inside your Timer Object's action ...

On this way, it is very easy doable to implement


    - OnLongClick events ...

    - onVeryLongClick events ...

    - exact timings for an event ...

    - change times for event-triggering ...


Have a look to attached HMI to see how things work together ...

HMI

1 person likes this idea
Login or Signup to post a comment