Wiring keypad in cube instead of matrix

Without diodes, you are right. But with one diode for each key, you would have full n-key rollover.