I wonder if there is any opensource project around to interface a usb keyboard and mouse to a ps/2 computer.
It's a passive adapter without any MPU inside, and it only works if your keyboard already talks PS/2.
It simply switch the keyboard into PS/2 mode. But things go more complex when you want to adapt a common keyboard or mouse that are USB-only.
Let me start by confirming, do you have an older computer that takes a PS/2 keyboard & mouse, but has no USB port, that you need to use - or - do you have an older PS/2 keyboard & mouse that you want to use with a newer computer that doesn't have PS/2 ports?
USB ports have been around for over a decade now, and any system without a single USB port is probably near useless at this point, but if that is the situation, PS/2 keyboards & mice can be found used on ebay. If it's a PS/2 system with at least one USB port, you can hang a USB hub off that port and plug a USB keyboard & mouse in, pretty much every OS released in the last decade will recognize them.
If what you have is an older PS/2 keyboard & mouse, or maybe an older KVM switch, inexpensive adapters to connect those to a USB port are available.
The computer only has PS/2 ports, it's a vintage machine and can't have any USB port.
But I need to use a USB keyboard and mouse. And I am willing to develop the adapter myself.
The computer only has PS/2 ports, it's a vintage machine and can't have any USB port.
But I need to use a USB keyboard and mouse. And I am willing to develop the adapter myself.
I am only aware of adapters for the opposite scenario (vintage PS/2 mouse/keyboard to modern USB computer), as also shown in the post above. Why don't you simply use a "proper" vintage keyboard and mouse with your vintage computer?
Vintage is one solution. But there are still plenty of new keyboards that come with PS/2 adapters/functionality and should work.
As for mice, I just looked on Amazon and new PS/2-only mice are still available, quite cheap. No adapter needed.
A little harder to fine, but I also found new PS/2-only keyboards as well. No adapter needed.
So either they're still supporting consumable peripherals for old hardware, or there's enough old stock PS/2 stuff still out there.
The computer only has PS/2 ports, it's a vintage machine and can't have any USB port.
But I need to use a USB keyboard and mouse. And I am willing to develop the adapter myself.
How old is this computer and what expansion bus does it use? USB expansion cards are available & dirt cheap and I'd be quite surprised if you couldn't find a usable PS/2 keyboard & mouse on ebay
I had a similar requirement recently. I have an old PC with only ps2 keyboard/mouse and I wanted to use a USB Keyboard/Mouse, so I purchased one of these:
https://www.tripplite.com/ps-2-to-usb-converter~0DT60002It is an absolutely overkill it cost me $120 but I wanted to see it in action, when I have time I would like to investigate making my own in a more compact form factor on a "dongle" format to plug into the proprietary ps2 port on my laptop.
as other have mentioned, a more cost effective solution is to buy a ps2 keyboard, or one that supports it through the passive adapter.
(Necro warning)
By coincidence, I came across this:
https://github.com/10110111/usb2ps2conv
and also this thread. So perhaps there are additional options available. 
Tim
Nice alternative...
I have a pile of very good "old" stuff which is being "obsoleted" by this USB fever...
ALAS.. has seen that a simple USB VID ID register is costing about U$10.000
I miss plain RS232.. much cheaper and easier... although bulky
Paul
Some of Digilent's Artix 7 FPGA boards (e.g. the Basys 3) connect a PIC24FJ128 to a USB socket to implement a standard PS/2 interface for communication with a mouse or keyboard. I have found this works better with USB mice and keyboards than any other solution (standalone adapters etc.) that I have tried. The hardware and PS/2 related-details are described in detail in the USB HID Host section of the Basys 3 documentation:
https://digilent.com/reference/programmable-logic/basys-3/reference-manual?redirect=1Unfortunately this is only a partial solution for my application (Project Oberon) because a) I need two PS/2 interfaces and b) I have not been able to locate the source code used to program the PIC. I'd be VERY interested if it, or an equivalent, was found so I could use the same technique with other FPGA boards.
Easier said than done when the machine doesn't have PCI(e), for example.

Or even when it does, the OS doesn't support it (e.g. Win95).
Why not update? Or upgrade? Some industries prohibit that (let alone if a viable upgrade path is even known for the given hardware, software and application involved), and with good reason!
Tim
So recently I found the need for this USB device to PS2/AT adapter.
Most of my Keyboards are USB and none of them seemed to be PS2 compatible ( with an adapter)
If could be really handy to have a USB device to PS2 output adapter.
usb2ps2conv seems like a good project, Has any one made one?
I have a STM32 Nucleo-64 board that i could try but im not sure if Nucleo boards are compatible?
Thanks.
No, both are passive converters, as stated in the product descriptions. They will only work with keyboards or mice which are already equipped with a combined USB/PS2 interface.
So the OP has special keyboard and mouse that he must use? I use those adapters with almost any USB keyboard or mouse I got and they work.