Although USB ports offer a range of advantages over other connection ports on a computer, the truth is that they are far less reliable than the standard PS2 from the 1980s. They are more likely to stop working or work intermittently which is why it is wise to be certain you computer has PS2 ports on its motherboard for both keyboard and mouse connections in case the USB ports stop working.
You can use the troubleshooting techniques described above to troubleshoot a non-working keyboard that is attached to a computer with a USB port. So, startup your computer and look for the LED lights to come on and check to see if your computer’s BIOS is set to halt in keyboard errors. If your USB keyboard passes these tests, you can move on to troubleshooting issues specific to USB keyboards.
If you computer has a USB keyboard, it is likely that your mouse also connects to your computer using a USB connection. Startup your computer and verify that your keyboard does not work after the operating system is finished loading. Now, check to see if the mouse is working.
First, if you are using an optical or laser mouse, turn the mouse over and look for a bright red (or maybe blue or green) light is coming out the opening on the bottom of the mouse. If not, this is an indication that no power is going to mouse and that the USB port is malfunctioning. Unplug your mouse and keyboard from their current USB connection and reconnect them into two different USB ports on your computer. Available ports may be located on the back of your computer on the motherboard or in the front of your computer.

click to enlarge
If your mouse and keyboard still do not work, there are two possibilities. First, the USB ports on your computer have stopped working altogether. In this case, you can try to connect your mouse and keyboard to PS2 ports if your computer’s motherboard has them. To connect a USB keyboard and mouse to PS2 ports, you will need
two inexpensive USB-to-PS2 adapters like the one shown in the picture.
Second, it is possible that both your keyboard and mouse are broken but this would be an amazing coincidence for them both to stop working at the same time. At this point, you should check to see if your computer is still under warranty and have a professional check out your computer.