I wrote this piece of code but I'm not sure if it work fine. I cannot test it because I don't have the Arduino yet.
My doubt is about the while condition, if I hold on the button "*" the function getState() will be "PRESSED" or after some time it will change in "HOLD" ?
Another question, if I push the button 1 and while I hold the button 1 I push the button 2, the getKey function will be 1 or 2 ?
Serial.print(" * has been pressed");
flash(ledPin,100); //flash a led for 0.1 sec.
unsigned long pressTime=millis();
Serial.println("The button * has been pressed for more than 2 sec");
pressTime=millis(); //so, out of the if condition