This article has some really good info on keypad entry. He shows how to count key presses
and convert individual entries to a usable variables. Ignore the circuit since you are directly
connecting your keypad.

http://www.rambal.com/descargas/libr...%20Display.pdf