Keypad schematic - is it correct?
If the diodes are that way, then columns should be inputs with pull-ups enabled, and rows should be outputs, the scanned row being low, and the other rows high.
If you want columns to be outputs, and rows as inputs, then the diodes are the wrong way around.