Digital IN + Multiplexer OUT for a keyboard. Is this a solution?
The Arduino you show in the picture has more than enough pins to scan a 5x8 matrix of buttons without a separate multiplexer.
The Arduino also can enable internal pull-up resistors on input pins, so you don't need external resistors either.
So simply set rows (or columns, depending on which way you want to do it) as inputs with internal pull-up, and the columns (or rows) as outputs, and the one output that is scanned is set to 0V, and all the other outputs are set to 5V.
Edit: Actually, the one active output should be set to 0V, and the other outputs should idle at high-impedance mode to simulate open-collector output, so that pushing multiple buttons does not short the outputs. This could be avoided by putting diodes to outputs if necessary.