Click keys to toggle. The diagram shows where to place diodes and how to wire rows & columns for a microcontroller scan.
This layout shows a typical 4×4 keypad matrix. Each button connects one column line to one row line when pressed. To avoid "ghosting" when multiple keys are pressed, place a diode on each key so current can flow only in the scanning direction (from driven column into row input). In the sample diagram the diodes are oriented from column → switch → row.