This just happened to me and I tried the following methods: (1) Compressed air blow on keys at an angle (didnt help) (2) Pressed many keys with a slight pumping action (didnt help) (3) Opened the back-panel, pressed the connection cables Sometimes this would work but then every morning the same issue would occur. So then I tried Apple Diagnostics by pressing “D” during start-up and weirdly enough my keyboard and mouse were working here, so that rules out a failing/loose cable. The diagnostics went through and stopped at one point complaining about the power being at 45W but requires 75W to proceed with full diagnostics. So I connected my charger and continued with diagnostics, where everything checked out fine. I then restarted normally and my trackpad and keyboard were working again :o At this point I am not sure if my battery is failing but it seems if enough power is not coming on the lines then the keyboard and trackpad are simply disabled.