Delay whit cancel

MorganS:

delay(12000);

The delay() function prevents the Arduino from doing everything. It can't read other buttons or respond in any way until that delay has finished.

boolean delayWithCancel(unsigned long duration) {

unsigned long start = millis();
  while(millis()-start < duration) {
    if(digitalRead(Button1)==LOW) return true;
    if(digitalRead(Button2)==LOW) return true;
    if(digitalRead(Button3)==LOW) return true;
    if(digitalRead(Button4)==LOW) return true;
  }
  return false; //action wasn't cancelled
}
void loop() {
  if(delayWithCancel(12000)) Serial.println("Cancel button pressed!");
}

Morgan, I am very new to arduino (Programming).
I understand half of what you have explained, thank you.

could you tell me how then modify my code.