In some machines is due to the old laptop battery. Let me not repeat why but skip to "the test."
Remove the battery and see if it works.
I have been having problems keeping my touchpad and keyboard functioning after taking my laptop apart. In the first instance, my touchpad stopped working a couple weeks after the dissection. I took the computer back apart, and re-secured the touch pad jack in the motherboard connector, and it worked again.
The second instance, which I havent been able to solve, is the keyboard keys. Certain keys will stop working after some period of use, usually a couple hours to a couple days.
I have tried readjusting the keyboard jack in the motherboard connector, also have tried turning off the computer and taking out the battery for a while.
Its an HP Pavilion dv5000 with Windows XP.