The easist way would be to keep track of the keypad input before/after you write it to the LCD. However, if you are writing the keypad input to the same location of the LCD, you can read it back provided you are using a normal 8-bit mode of communication with the LCD. It may be possible in 4-bit mode, but I'm not sure. I have had a few occasions where I've had to use the LCD as a sorta RAM so I know it can be done. FWIW, even a simple 1x8 or 2x16 LCD _often_ has the same CGRAM as a 2x20 module so there are often a few spare bytes in there. I forget the exact command sequence, but look at the datasheet for the LCD controller and you will see how to read info back from it