When replacing the keyboard, make sure that the cable is clean and insert it directly into the connector, making sure it makes contact with the bottom of the connector.
If the cable does not touch the bottom of the connector, the keyboard function will be rendered useless.
The cable of the keyboard is fragile and could be damaged. When removing the keyboard be careful when pulling the cable out.