Chosen Solution

I just replaced my trackpad and battery after battery swelled and cracked trackpad. Now the keyboard doesn’t work.Why?

You didn’t tell us your year model but this guide should suffice. See steps 15-17 of this guide:MacBook Pro 15" Unibody Mid 2012 Upper Case Replacement Reseat the keyboard cable. I use a a piece of electrical tape to pull it into place rather than trying to push it in. Just remember to unlock it first, pull the cable all the way in, then lock it down.