Hi everyone.
I want to make a USB board with 9 switches and NKRO. It doesn't really matter how many many rows and columns are in the matrix, but one row/nine columns is prefered. Which controllers provide the right amount of I/O pins and supports USB? Do you know any legitimate templates of the code that can be used here?
I aim to use Cherry MX switches and 1N4148 diodes for NKRO.
Which kind of microcontroller you plan to use? AVR (from Atmel)? ARM? Another familiy of microcontrollers (like PIC)?
You can do this project with whatever microcontroller you want. Some are easier than others for that, though. As a rule of thumb I use Atmel ATmega32U4 microcontrollers for my projects, it serves me well: it have 26 I/O pins, but typically you can use only 25 (one of the pins have to be pulled down to enable the bootloader).
For such a tiny keyboard you can use ATmega32U2, it have 20 I/O pins, more than enough for your project. And it is cheaper then the 32U4.
As for the firmware, I can recommend 3 options:
Soarer's,
TMK and
Easy AVR, but beware: only TMK supports the ATmega32U2 AFAIK.
I hope I could be of some help. Welcome to Geekhack!