Try to connect your keyboard and mouse on other USB ports. If its connected at the back try the USB ports at the front of your CPU. Check the Device Manager if there is a problem with the drivers for your keyboard and mouse specially if there are branded ones like Logitech or Microsoft brands. If nothing else works, there could be a slight problem with your OS particularly the one that controls Plug and Play Devices such as USB devices. Try to scan you PC for viruses.