This question already has an answer here:
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.