It could be that the windows driver for your ps/2 keyboard has become corrupted, and that's why it works in windows but not on startup. There are a couple of ways to fix this; usually run the SFC /SCANNOW command in an elevated Command Prompt window as Administrator. That's the System File Checker; it's good to run that first to see if the default ps/2 keyboard driver in windows has been compromised somehow. SFC can make that determination and repair the file by overwriting with a fresh copy. You may not care about fixing that since you got it working with the usb keyboard, but that's an answer to your question. That problem is usually repairable through software. If not, it's quite likely that the one ps/2 port or both *that model PC seems to have 2 ps/2 ports as was standard on older hardware* is or are bad. Since those ports are hardwired into the Motherboard; the fix at that point requires complete Motherboard replacement.
<<<BIGBEARJEDI>>>