First, try an SMC reset if you have an Intel-powered Macbook Pro: How to reset the SMC of your Mac - Apple Support
If that fails to help, then check to see if the battery is swelling. A swollen battery puts upward pressure on the bottom side of the trackpad mechanism and can create unexpected input or no function at all.
Set the MBP on a known flat surface and see if all four rubber feet make contact. If it rocks a bit, or you can see varaition in the width of the gap between the bottom cover and the main body of the computer, the battery is swelling.
A swelling battery can damage a computer beyond repair, and swelling gets worse by the day. If you suspect the battery is swelling, get it to an Apple facility for evaluation as soon as possible. Waiting wil make things much worse.