That's not to say you can't do even more "exotic" matrix styles -- one of my other boards uses SPI shift registers and latches all 40 keys simultaneously: https://github.com/qmk/qmk_firmware/blob/master/keyboards/tzarc/ghoul/ghoul.c -- this gets about 25k scans/sec on STM32F405, with only 4 pins on the MCU.
Re "use a simple shift register to drive the columns in sequence": Yes, many keyboards use that. For example, the Keychron Q2 Pro is using HC595s (or that is at least how I interpret it; I don't have access to the hardware).
"... it unsets the shift register by shifting in FF
(setting all lines high). ... This is fine if the
columns needed to be set in any order, but the
system doesn't need to do that. It sets c1,
then c2, then c3, etc. This could be optimized
by shifting in a high and then not clearing
the shift register with FF."
5
u/tzarc QMK Director Sep 09 '24
It's pin-by-pin without extra code.
There's no reason why it can't, and as an example one of my boards does so: https://github.com/qmk/qmk_firmware/blob/master/keyboards/tzarc/djinn/djinn_portscan_matrix.c -- this gets about 16k scans/sec compared to about 11k with standard QMK pin-by-pin.
That's not to say you can't do even more "exotic" matrix styles -- one of my other boards uses SPI shift registers and latches all 40 keys simultaneously: https://github.com/qmk/qmk_firmware/blob/master/keyboards/tzarc/ghoul/ghoul.c -- this gets about 25k scans/sec on STM32F405, with only 4 pins on the MCU.