If your computer is one that allows the user to remove & replace the battery, remove and
then inspect it. Should it be expanded or tight fitting, or bulging, then do not re-install it.
An expanded battery can force pressures against the inside of the computer and that has
been known to cause keyboard and trackpad issues in portable Apple computers. And of
those with removable batteries, it is best when caught early & a replacement battery fitted.
Sometimes the battery may leak, so that would have to be blotted up and allowed to dry;
there may be some kind of neutralizing agent, but if the battery has leaked, ask an expert
of someone at an Apple Store, or authorized Apple service provider. They also may have
a replacement battery or know if you can get one locally. Consult the expert or Genius,
whichever is available, about the keys and if the battery is the cause. Any Warranty?
If the keyboard itself is the issue and did not have a related expanded battery cause, it may
be you'd have to consider a replacement top half of the lower case; the keyboard on the
MacBook/Pro may require that. Or the keys themselves may have something under them,
and there are some instructions online on how to remove & replace the key-faces. There are
more than two kinds, so be sure if you do that, check since details will make a difference.
• How to remove MacBook Pro keys (temporarily remove/replace)
https://www.google.com/?gws_rd=ssl#q=how+to+take+off+macbook+pro+keys
• An example of upper case replacement (keyboard/trackpad) 13-inch MacBook/Pro Mid-2012:
https://www.ifixit.com/Guide/MacBook+Pro+13-Inch+Unibody+Mid+2012+Upper+Case+Rep lacement/10377
At one point, for a different model Apple portable, I'd found more information about replacing
key-faces and the scissor spring things underneath. Some companies will sell just these parts.
Good luck in any event! 🙂