Simple Digital Reading ?

Hi everyone, i have this sketch below, a simple digital read for push button example .

however of course, the program will keep on scrolling down updating the state of the button for every delay time i set .

what i want to happen is to only display a reading THE MOMENT I PUSH THE BUTTON ,
if i hold it still,, it will only display only one piece of "1" in the serial monitor . and the moment i stop holding it , it will only display
only one "0" .

is that possible ?

Yes, it is possible. See the example "StateChangeDetection":

specialy the line:

  if (buttonState != lastButtonState) { 
   (...)

thank u so much sir !