Feed values to an array using keypad interfaced with Arduino Uno
customKeypad.getKey(); doesn't wait for the key press. it returns 0 if no key is pressed.

you should rewrite the sketch to a version where the loop() can loop and key presses are read as they are pressed.