Is it a USB keyboard?
![](https://t3.gstatic.com/images?q=tbn:ANd9GcR3SBtHcyztzS_h87p3lmsYYnZtXBdz6D_JOLFvDjK_PIcOCQ9PGA)
Or is it the "old-time" PS/2 keyboard?
![](https://t3.gstatic.com/images?q=tbn:ANd9GcREiafH6te67CeQZ6I6_nN152jZrkCBOjeebWqTX9QI-OZ5tDNTTw)
Have you tried unplugging and re-plugging in the keyboard? If it is the old-style PS/2, do not unplug or plug it in when the computer is on. Make sure the power is off.
USB is more forgiving -- you can unplug/plug in USB while the power is on, though sometimes, USB keyboards get strange, and best to unplug/plug in while power is off, then restart.