The keyboard and mouse are peripheral input devices. The reason for their freezing can be a technical malfunction of the devices themselves or the motherboard, as well as errors of the operating system.
Technical malfunction
Operating system errors affecting the operation of peripheral devices are detected after the main OS is loaded. Check for a faulty keyboard in the BIOS (Basic Input / Output System). To do this, after the initial hardware poll and the POST beep, press the F10 or Delete key, depending on the BIOS version, and open the menu items one by one. If the keyboard does not work, then the problem is technical.
If you have a mouse and keyboard with ps / 2 connectors (small circular 6-pin), make sure not to mix up the mouse and keyboard ports when connecting. They are marked with the color or images of these devices. Make sure the pins in the connectors are not bent or broken. Check if the mouse and keyboard are working on the other computer.
Connect devices to the ps / 2 connectors only when the power is off, otherwise a short circuit may damage the port.
The south bridge on the motherboard may be overheating. Remove the side panel of the system unit and find 2 large microcircuits on the motherboard. Try the bottom carefully. If the microcircuit is too hot, it makes sense to contact a computer service.
Remove the round battery that powers the ROM chip from the socket on the motherboard. Use a screwdriver to overlap the electrodes in the connector for a few seconds to reset the BIOS to factory defaults. This will help if you unsuccessfully changed something in Setup.
Operating system errors
The mouse and keyboard may freeze due to malware. Download a LiveCD image with installed anti-virus programs from DrWeb or AVP sites and burn it to a CD. In the BIOS, set the boot order from the CD or DVD drive and boot the computer from the disc. Check the system with an antivirus.
If the mouse and keyboard freeze while booting from the LiveCD, the problem is with those devices or with the motherboard.
The reason for blocking may be incorrectly installed drivers or other programs. Turn on your computer and press F8 after the POST signal to bring up the Windows boot options menu. If you have Windows 8, use the Shift + F8 keys to bring up the menu. Choose the item "Safe Mode". If the devices react to your actions in safe mode, uninstall the recently installed software.
Press Win and in the "Programs" section select "Accessories", then "System Tools" and "System Restore". Following the instructions of the recovery wizard, depending on the version of Windows, specify the closest checkpoint creation date.