How the diodes should be fixed using keypad library?

I want too use multi-keypress……but i got a ghosting key problem.
May be add diodes is the only way too solved it?
But what the positon should the diodes be installed?
It should toward the row ?or the column?

@mstanley Clold you help me?
My English is poor

I see it but I could not found how to install the diodes.
Or is there any other solfware way to solved it?


I can understand how diodes works when use pull_down resistor.
But the library seems uses pull_up resistor.And the input need to connect to LOW Level .
But if there is no voltage how could the diodes work?