MIRKOSOFT.
Every body here is confused about what you are doing?
First of all is this something your really have to have or is it something you would like?
Do you have two computers? if so, what is the proper designation of each?
Does each computer have a working keyboard?
Jere is what I think you have.
1. An older PC made by Compaq with a keyboard.
2. A Commodore 64 that does not have an external keyboard.
You would like to use a switch to use one keyboard for both computers.
Is that what you want?
I repeat, the Commodore never, ever has a PS/2 connector. It is NOT a PS/2 connector.
I am often wrong. But I think I am right on this. The commodore 64 never had a PS/2 connector. Some few users modify the Commode to use a PS/2 keyboard. It is never easy. It requires very specific things to make it work.
I can not get the URL to work here. If you med the information, I will ha veto make a URL for the site. It describe an elaborate modification to force the Commodore to ;use a PS/2 keyboard. If it were easy, they would have found it earlier. There are more sites like tart.
Also, there is a way to get USB support on the Commodore. But hat is another thing.
EDIT: Here is indirect URL:
https://tinyurl.com/C64-to-PS2