Diodes are not required.
What the library basically does is have all the column lines high.
It then brings 1 low, and reads the row pins. If a low is seen, it knows the active column, and now the row, so it knows whic button was pressed.
Then on to the next column...