Laptop keyboard randomly not registering So one day I opened my MacBook Pro, only to find that none of the keys were registering. A few seconds later, it gave me a popup that there was no bluetooth keyboard detected. My trackpad was also not registering. The only button that seemed to be working was the power button. When I pressed the power button, it brought up the usual popup dialog about whether I wanted to sleep, restart, or shut down. I had no way to click on any of the options, so I just held down the power button to force shut down. (Opening and closing the laptop didn't do anything).

When the computer booted back up, everything was working fine. I used my computer like normal, until a few days later, it happened again. o I did the same thing. This was maybe 5 days ago. And today, it happened again.

So it's not happening every time I use my computer, not even close, but it's still annoying, and I'd rather it didn't happen.

I didn't do anything to my keyboard before this happened, so I have no idea what could be causing it.

Anyone have any ideas?

EDIT: This question is not a duplicate of the linked question because in that question, the asker is having issues with specific buttons being stuck down. This seems like a physical issue with the hardware. In my issue, my computer is not registering my keyboard, and it telling me there is no keyboard attached. I haven't spilled anything on my keyboard or done anything else to it, so it seems like a software issue. I would share screenshots, but when this happens, I have no way to take screenshots.
I would reset the SMC on your Mac. Of course you would need certain keys to work for it to be successful. 

How to reset the System Management Controller (SMC) on your Mac

https://support.apple.com/en-us/HT201295

If that doesnt help, my next suggestion is to boot the Mac into Safe Mode and test the keyboard. If the keyboard works then you may need to just reinstall MacOS. If it doesnt then you may need to call Apple Support and set up an appointment for your local Apple Store if you have one.

Use safe mode to isolate issues with your Mac -
 https://support.apple.com/en-us/HT201262

Here is an interesting article by MacWorld

https://www.macworld.co.uk/how-to/mac/how-fix-mac-keyboard-3598931/