Quick question, have you cleaned the contacts and blown out the keyboard connector slot?
I have found mine to be a bit of a dust magnet and one occasion where the keyboard started to be a little intermittent found it was due to crud.
If you have a slightly unstable connection on the left hand side of the connectors, and if your keyboard is in the elevated not flat position, ALT-TAB 'ing may flex the contacts on the keyboard on the left enough to clear and reconnect. YMMV