Advertisement

Time button is pressed

Started by January 07, 2016 06:13 PM
10 comments, last by Omar Bentaleb 8 years, 11 months ago

Look into keyboard macro programs (or whatever theyre called) and keyloggers etc. Since they log the times of recorded events (which seems to be what you want).

Eg I found this with some googling, and in the picture near middle of that page it shows some events, with duration in milliseconds (I dont know, you have to record some keypresses, then open that edit window it shows??).

But I doubt anybody is going to write you a program - you didnt even say why you need it or give any sort of detail, and writing a program takes time. At least not for free.

edit:

If you want to write it yourself, youll need to know how to program (at least basics). If you do know how, or if you dont but are willing to dedicate lots of time to learn, then do say so.

hi thank you for your help what i'm trying to do is to sync music with LED light for example i follow the beat of a song by pressing a button then i program the led with my arduino so the led will sync with the beat

Its simple but if you want a code example you should specify what you're using. You just need a way to store time and to tell if the key is down or the key is up.


if(isButtonDown())
{
  clock.start();
 
}

if(isButtonUp())
{
  clock.stop();

}

i just want a code that let me calculate time button is pressed on my computer keyboard

But why do you want that?

There are a lot of ways to do it. Easy ways like using a library, and hard ways like writing everything yourself. We can't give you code without you specifying what language you're using or if you're using a library.

kk

This topic is closed to new replies.

Advertisement