I will check further. I am using the f877 pic. Note that I tried changing this line to "4". Is that wrong?

DEFINE KEYPAD_COL 3 ' 4 COL keypad

Looking at it now I realize that its probably 0 to 3 which is 4 states or columns. So the above line should stay as it is?