Comments (1)
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)
- Possible conflict with TC3 library on SAMD21 architecture ?
- can it be used with a SN74HC165 is a 8-Bit Parallel-Load Shift Registers
- arduion libray issues HOT 2
- Code_ESP32_Blynk_Bluetooth_WiFi_Switch_control_8_Relays_02.ino:27:21: error: variable or field 'button1Handler' declared void
- use of __FlashStringHelper is ambiguous HOT 7
- invalid use of non-static member function 'void Interface::handleEvent(ace_button::AceButton*, uint8_t, uint8_t)' HOT 2
- call of overloaded AceButton(int) is ambiguous HOT 1
- call of overloaded 'init(int)' is ambiguous HOT 1
- Capacitive button returns release while button is pressed HOT 2
- [OT] featuring AceButton HOT 2
- Public method to supress long kEventLongPressed HOT 10
- Tri-state button example HOT 2
- No longer responding to single click HOT 1
- Examples depend on "using namespace ace_button" in the global namespace
- How can I use it with port extender?
- I want to set setDefaultReleasedState to LOW
- ESP32 Support? HOT 1
- Could we make `isLongPressed()` public?
- Two button both pressed (sample LongPress)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acebutton.