Your problem is the use of a for loop to gather the key presses. To understand what is happening, consider the result when getKey() returns NO_KEY. The for loop does nothing and you print out the four zeros you initialized your array with. Restructure your code to check for a key press each time thru the loop() and store key presses until you get four of them.