Just a thought. It may have a dry solder joint.
If you have a small soldering iron, find the section where the ribbon cable connects to the keyboard, add a small amount of solder to each connection - just long enough to see the joint melt.
If you can do the same at the other end of the cable, even better.