If your keyboard gets locked up, disconnect it from the computer, wait a couple of minutes until Windows unloads the keyboard driver, and plug the device back in to force the operating system to reload the driver. If this fails, try connecting the keyboard to a different USB or PS/2 port on the computer. Additionally, connect the keyboard to another computer to ascertain whether the computer ports or the keyboard itself is at fault.
If you have a USB hub that uses an external power supply, make sure it is connected to the power source before connecting the keyboard to it. Check the keyboard cable for any signs of damage, and test the USB and PS/2 ports on your computer with other devices to make sure they are functioning properly. If you are using a wireless keyboard, check if the battery is functional and charged. Alternatively, disconnect the USB wireless receiver from the computer, wait at least 10 seconds and plug it back in to establish the wireless connection again.
If the keyboard is unresponsive and producing beeping sounds when you press a key, disable the Sticky Keys settings via the Control Panel. To do this, access the Control Panel, click on the Ease of Access Center link, select the Make the Keyboard Easier to Use and then uncheck the box next to the Turn On Sticky Keys option. If this fails, reset the keyboard settings by booting the operating system into Safe Mode, removing all devices from the Keyboards section in the Device Manager dialog box and restarting the computer while the keyboard is connected.