Is it possible to make arduino working as 7pin keypad?

Is it possible to make arduino working as 7pin keypad ? I have a PCB attached 7pin keypad but I want to replace it with arduino. I try to simulate its signal but not success yet.

I knew that I have to simulate signal as the above image but it still not corrent. I got;
3+2 → 1
1+2 → 2
5+2-> 3

3+7 → 1
1+7 → 2
5+7 → 3

3+6 → 1
1+6 → 2
5+6 → 3

Anyone have an idea what i wrong. Please advice me. Thank you

Pressing a key connects two pins. For instance, pressing the 5 key connects pins 7 and 1. What that actually means is that whatever is operating the keypad needs to apply current to pin 7 and read pin 1. If pin 1 is high while current is being applied to pin 7, then button 5 is being pressed.

When the Arduino is operating a keypad like that, it cycles through all the pins, apply current to the appropriate pins, and reading the appropriate pins. When it detects that a switch is pressed, it returns the value of the switch.

Making the Arduino pretend to BE a keypad is probably not trivial. It would need to understand when the controlling device is trying to apply current to, and read the state of, some combination of pins, and set the correct output HIGH at the correct time.

That has been done to automatically program very old computers via a keyboard.

Use 12 relays, or even better, use 12 reed-relays.
If the rows are sequencing outputs and the columns are inputs (or vice versa) then probably 12 optocouplers can be used, or 12 analog switches, like three CD4066 chips.
You should check the signals, if the voltage is 5V, perhaps normal transistors or mosfets can be used as well.

To be able to connect to an Arduino in a smart way, you have to analyze the signal with a logic analyzer and try to see what is happening. There will probably not be a smart way, so you end up using those CD4066 chips after all.