Hi,
For a basic 4x3 matrix you need 4 output and 3 inputs OR 3 outputs and 4 inputs - up to you really. The outputs drives the columns (or rows) and the inputs reads the rows (or columns).
Pull up the inputs, drive one of the outputs low, read the inputs. If any of the inputs reads low you have a button pressed. Drive the next input low, read the inputs and so on.

If you search the forum I'm sure you'll find examples.

/Henrik.