Search code examples
javascriptjquerymorse-code

JQuery: has a button been pressed again within so many milliseconds


I'm writing a web application that decodes Morse Code that is tapped in using mouse button.

I originally did a proof of concept using conventional JavaScript, but now I'm redoing it using jQuery.

Is there a clever way with jQuery to tell if a button has been pressed again within so many milliseconds, or not - and run some jQuery code if the button was NOT pressed again.

I've been going over the jQuery API and I'm not seeing a clever way of doing this....

Any ideas...

Derek


Solution

  • I suspect you'll need to monitor the buttons' click events and do the timing yourself.