Long-Click Detection without Long-Click BLock

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • Nukles
    Smart Home'r
    • 08.12.2024
    • 42

    #1

    Long-Click Detection without Long-Click BLock

    Hi everyone,

    I'm trying to implement a long press detection on a push button without using the built-in Long Click block, and I'd love to hear how others have solved this.

    The reason I want to avoid the Long Click block is a timing issue: the block only confirms a long press after 3× the TI parameter. This means that if I set TI = 0.5s (to keep the short click responsive), the long press is only detected after 1.5s — which feels sluggish. On the other hand, if I lower TI to make the long press faster, the short click threshold becomes too tight and unreliable.

    What I'm looking for is a solution where:
    - Short press is detected quickly on button release
    - Long press fires at exactly my chosen threshold (e.g. 1s), not 3× it
    - The two outputs are mutually exclusive

    Thanks!
Lädt...