Many things can cause this to happen... a bad port (connector) on your computer, something set in your BIOS is wrong, PnP (Plug and Play) is not finding the device (keyboard), a device conflict. The keyboard is one of the easiest things for your computer to find. The BIOS finds your mouse 1st. Your Operating System finds the keyboard along with all other devices. Then there is software for your keyboard if thats not installed your keyboard may not use all functions right. You never said the OS your using? I suggest you look at the options in your BIOS and see if any defaults are set wrong with PnP? If you can try another port on your computer to connect your keyboard. If you can get into desktop go to devices and look at hardware and see if OS found keyboard and if there are any conflicts and fix them if there are any with keyboard port number, every piece of hardware should have a separate port number assigned. The information you gave is so vague, you don't even say if your using a PS2 connector or USB for your keyboard connection to your computer??
I think you have got problem with your ps/2 port. Plug-in a usb keyboard and watch the result. If the problem persists, try to reinstall your operating system to avoid possible worm or spyware attacks. You can check there for more suggestions http://www.techyv.com/questions/why-no-keyboard-work-my-keyboard-port
both answers are good but I do hope you re-booted your computer.
You should check your bios setting for your computer.. may be possible that the port is being disabled by some reason.... so you should check the BIOS setting... and it may also be possible that the port get some problem..
Other people asked questions on similar topics, check out the answers they received:
Other people asked questions on various topics, and are still waiting for answer. Would be great if you can take a sec and answer them