decreasing keypad pins

Or you could use a decade counter for the rows, using only one output pin to advance the count. Lots of possibilities, using some type of shift register or counter.

Research shift register and counter ICs. Take your pick.