GithubHelp home page GithubHelp logo

Comments (1)

bxparks avatar bxparks commented on June 18, 2024

I've been mulling over this for a few days, and I think I understand what you are trying to do. The problem is that the current kEventLongReleased is not intended to mean to what you want it to mean.

The current kEventLongReleased event was a solution to a very specific problem, as described in Distinguishing Pressed and LongPressed: When the kEventReleased is suppressed to allow the differentiation between Pressed and LongPressed, we lose the kEventReleased from the LongPressed, so the kEventLongReleased was added to compensate.

Your version of kEventLongReleased is different. It is the symmetric equivalent of the kEventLongPressed, triggered when a button is released for a long duration. I never considered this to be an event, because by default, the buttons are considered to be in the Released state, and it did not seem that an event should be triggered without a specific human action.

If we were to implement your version of kEventLongReleased, then by symmetry, it would imply that we should implement a kEventRepeatReleased which triggers every 200 milliseconds in the Released state, in the same way that kEventRepeatPressed is triggered. I'm not sure that makes sense.

So I have a counter-suggestion: You are essentially using the LongPressed event to perform debouncing of your water level switch at a much larger timescale than the usual 20-50 milliseconds. You want to a debouncing at the level of 5-10 seconds. So instead of using LongPressed, is it possible to achieve your goals by using the normal kEventPressed and kEventReleased, but increase your setDebounceDelay(5000) instead?

from acebutton.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.