Ok, am I a little harsh, maybe, but when you have a keyboard that you don't use very much, just think of the wasted CPU cycles scanning the Keyboard! I one minute, in one hour? So what to do? In steps our 8 input to 3-line, Priority Encoder TI SN74x148.
Ok, you ask what is a Priority Encoder? Put it simply it is a device that will generate the proper output for any given key. (update #2) So let's say you pressed 4 to a ground state, its output would be 001 hex or 4 (table 1). Plus the GS pin will go low. Cool. But beware if you doing this method you will be generating a processor interrupt, so you must eliminate switch bounce with a Schmitt Trigger.
The picture below is from the TI datasheet mentioned in the link above. Please remember that to pull the TTL device to the ground from a high, one of the switches must be connected to the ground while the other side of the switch is wired to a pin on the priority encoder is high which means that you will need a pull-up resistor.
So the only thing your software has to do when the interrupt is active is to read the 4 BCD data lines and perform a table lookup.
So in recap here is what you need:
Your software is now simplified as if you know the value of the nibble, a simple 1-dimensional table would be all you need as you most likely want ASCII output. A quick review of C ints and Chars are the SAME! My keyboard has 0-9, ENT, KBD, CLR, TGT