Matrix Keypad - Optimisation

The resistor approach would not work even if noise would not be present. There are some LCD shields with a similar setup (but less resistors). This works "mostly". The issue is temperature drift. You resistors can drift enough to be detected as the wrong one --> will fail especially in summer.

The standard approach is to go for shift registers. This is described in the playground. You can either use a shift register for reading or you can use a shift register for pulling low keys in order to read if they are pressed. The second approach would require one bit more but would allow to pull all low at the same time. Then this could be detected during an interrupt which then determines which was actually pressed.