Comments (17)
you're the boss!!! The tap handler did solve my issue. Thanks for all the help!!
from button2.
Thanks a ton!
from button2.
(Almost done - still have to do long click...)
:-)
You are welcome.
from button2.
You made me grin! Thanks again. Its not a full keyboard, just a few keys for a custom remote keyboard, trying to avoid complexity by not using a keyboard matrix.
from button2.
No. No downside. It does not respect the double or triple click timings. Thus, it reports clicks immediately.
from button2.
Hey @pablopeu,
thanks for the feedback. I added two compliler switches (_IGNORE_DOUBLE and _IGNORE_TRIPLE) to the code.
It is not in the released version yet, as I want to add a longpress switch as well.
But if you download the latest version you can already use it.
Cheers
l.
from button2.
While you are at it, with the disable longpress switch, will I be able to detect two/three keys pressed at once? Think of CTRL-ALT-DEL or CTRL-X when emulating a keyboard like I'm doing. Thanks
from button2.
I knew you'd ask. :-)
Take a look at TrackDualButtonClick
. Set flags for "special" keys and go from there.
But if you do a real keyboard, I'd look for a keyboard matrix library instead, I think. Less pins to take care of.
from button2.
done.
from button2.
Hi, added the #define at the top of my program, downloaded latest library code, overwrited previous one, uploaded new code to ESP32 but doubleclicks do not behave like rapid single clicks, made a short video: https://www.youtube.com/watch?v=b83OWDCFgO4
from button2.
Hey, try to uncomment the defines in the library itself.
from button2.
Did it and saw the compilation messages about the routines not being compiled, but still doesn't catch a fast click, maybe its because Im reading 12 buttons, dunno.
from button2.
Hey,
I think you don't see some of the "fast clicks" because of the thresholds for double and triple clicks are still there.
A way around this could be to use setTapHandler()
.
This one is triggered on any click.
from button2.
will look into it and let you know! Thanks Lennart
from button2.
Did a quick test that worked, then did a find & replace on my full program: setClickHandler to setTapHandler and recompiled. Man, what a difference in responsiveness, its super fast on all the defined buttons (10 at this moment)
Thanks for the suggestion. BTW, is there a downside to using setTapHandler?
from button2.
pushed new version (2.1.0)
from button2.
Hey, I decided to remove the compiler switches as the tap handler solves your question. They only made the code more complex and did not really reduced the compiled code size.
Cheers
l.
from button2.
Related Issues (20)
- Feature request: be able to set your own _getState() callback function HOT 2
- Active low button don't work with the library HOT 5
- Question: what should `wasPressedFor()`return for double and triple clicks? HOT 1
- Use Button2 with Touchsensors in my Esp32 HOT 2
- Decalring SetHandler time HOT 3
- Possible issue with button released. HOT 1
- getType() with Long Click Detected HOT 1
- Read initial value during boot HOT 4
- Is there a way to run the button.loop function in the background using an interrupt timer ? HOT 11
- Error Compiling For ESP32 C3 HOT 5
- LongClickDetectedHandler triggered after boot? HOT 8
- Filtering out Single press while waiting for the Long Press HOT 3
- Suggestion to add options for Led Buttons HOT 1
- Long click retriggerable stopped working in a recent update. HOT 4
- .pio/libdeps/seeed_xiao_esp32c3/Button2/src/Button2.cpp:186:20: error: 'touchRead' was not declared in this scope HOT 2
- detection of long presses does not work properly inside of an interupt timer HOT 2
- Interrupt wdt timeout on CPU1 HOT 2
- button.isPressed(); seems to stay latched. HOT 1
- Long press is not reported in polling mode HOT 1
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 button2.