Quick question: do I need a resistor for a keyboard key switch
You need resistors to protect the outputs of the keyboard controller, at least.

If you scan rows and read columns, then pressing two keys in the same column at the same time will connect two row outputs, while one is high and the other is low, leading to a short. So the bare minimum are current limiting resistors in the row lines, around 10k should be sufficient.

However, if you press two keys in the same column, the column line will then be driven to half the supply voltage, and you cannot get a clear reading then.

If you instead add one diode per key and a weak pulldown for each of the columns, you can build the matrix so that the column readback will capture the true state of each key, even if multiple keys are pressed at the same time. This is a bit more expensive, but definitely worth it if you ever want to use your keyboard for gaming.