Do you have a old motherboard ? Maybe it has some problems with usb's so you should try with a PS/2 keyboard. If it's not working, disassemble your computer and try it with no case. Look inside your case for metal things making contacts (standoffs, etc.) If it's working out of the case, it may be some metal piece making it not to work.
- The Brownie