My keyboard keeps cutting out?

I have a lenovo keyboard, it's 3 years old and it keeps turning on and off, all the keys stop working and the lights on it will die, and then flash, and go back on. It started a couple days ago and wasn't so bad but it's gotten to the point where I can barely type because it keeps going out. I don't have money for a new keyboard. Is there anything I can do to fix it?

Most probably there's a loosen wiring in your laptop. The main connection from keyboard to motherboard. That's why sometimes its working and sometimes not. Try to shake it (not so hard) so maybe the wires will get back in place but i'm sure it will not take long before it loses connection again. Just bring it to any laptop repair shop near you they will just weld back if ever thats the problem. Welding wires is not expensive

If your mouse or other usb device is connected to the port next to the one used for the keyboard try moving that device to another usb port. Leave the usb port next to the one for the keyboard free.

Try to use another keyboard if problem got solved means the keyboard is damaged, else contact me