The 3x4 and 4x4 matrix keyboards are commonly used for user input. Usually, the row and column wires are connected to GPIO pins on a microcontroller. A simple approach requires 7 wires for a 3x4 keypad.
This article introduces a new technique wish reduces the number of GPIO pins down to 6, 5 and even 4, using software scanning techniques and diodes.
Even though this reduces GPIO pin requirements in a manner similar to charliplexing, this is a different design.
Complete article at https://wiki.pbeirne.com/patb/KeyboardScanning/
Cool, those are useful techniques. Sometimes for the scanning lines you can use pins that are already outputs to do double duty, e.g. the digit drive pins in a scanned display. That's how it was done in calculator and clock chips some 50 years ago.
There are even single chips that handle both display and key scanning, e.g. the TM1637 that has a 2 wire interface. You could even not use the display part of the chip, then you'd have a keyboard interface with 2 signal lines, at the cost of firmware to decode the protocol.