Each press closes the press button circuit and two lines are shorted. It is very easy to detect this situation from Arduino to know the key pressed. Matrix keyboard with multiplexed outputs in 4x5 lines.
eBay