Giter Site home page Giter Site logo

Comments (17)

pablopeu avatar pablopeu commented on June 27, 2024 2

you're the boss!!! The tap handler did solve my issue. Thanks for all the help!!

from button2.

pablopeu avatar pablopeu commented on June 27, 2024 1

Thanks a ton!

from button2.

LennartHennigs avatar LennartHennigs commented on June 27, 2024 1

(Almost done - still have to do long click...)
:-)
You are welcome.

from button2.

pablopeu avatar pablopeu commented on June 27, 2024 1

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.

LennartHennigs avatar LennartHennigs commented on June 27, 2024 1

No. No downside. It does not respect the double or triple click timings. Thus, it reports clicks immediately.

from button2.

LennartHennigs avatar LennartHennigs commented on June 27, 2024

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.

pablopeu avatar pablopeu commented on June 27, 2024

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.

LennartHennigs avatar LennartHennigs commented on June 27, 2024

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.

LennartHennigs avatar LennartHennigs commented on June 27, 2024

done.

from button2.

pablopeu avatar pablopeu commented on June 27, 2024

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.

LennartHennigs avatar LennartHennigs commented on June 27, 2024

Hey, try to uncomment the defines in the library itself.

from button2.

pablopeu avatar pablopeu commented on June 27, 2024

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.

LennartHennigs avatar LennartHennigs commented on June 27, 2024

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.

pablopeu avatar pablopeu commented on June 27, 2024

will look into it and let you know! Thanks Lennart

from button2.

pablopeu avatar pablopeu commented on June 27, 2024

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.

LennartHennigs avatar LennartHennigs commented on June 27, 2024

pushed new version (2.1.0)

from button2.

LennartHennigs avatar LennartHennigs commented on June 27, 2024

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)

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.