Use a char, not an int. What you are after is an ascii value here. Try to work in small increments. For instance, start by saving 3 consecutive chars into a fixed-size array and print the result to serial as a whole string. Then add a timeout that will start the recording over if too much time passes after the first or second key press and put out an error message to serial.
P.S. Remember to declare something like char code[4] to make space for the terminating null char.