I'm afraid that some water penetrated the motherboard... Check your motherboard for oxidation and try cleaning the keyboard connector carefully. Then make sure to reconnect properly the keyboard ribbon cable into the connector.
Thank you for the reply. When I took the laptop apart I didn't see any visible water residue so I'm not sure if that's what you mean by oxidation. I would appreciate some pointers to how I can check that.
The keyboard is connected to a sub card, which in turn connects to the motherboard, so the problem could also be there, although I didn't see any signs of water damage either.
I will check it out again with an external keyboard