Debouncing many switches used for MCU input via a shift register

If you place diodes in series with each button, they can be read independently by the matrix.