Sleepy laptop, just woken from it's slumber - you caressed one of its input devices - moved the mouse, touched the touchpad, or pressed a key. And if you did the latter, sometimes you trip into this little issue - the keyboard is funky!
It's all caps when you don't have the shift key or caps lock on. Number keys are reversed - eg, press '1', and get '!', but press '!' and you get '1', or nothing normal is happening, but something sure is.
The nice Windows operating system has saved your laptop's battery by putting itself to sleep. A very nice feature, and it does massively extend the battery run time. And for desktops, reduces power use. In fact, in the bowels of the machine, lots and lots of engineering effort has gone into turning off modules, putting functions into low-power or power-down states, shuttering cores not required for the load at the moment, and turning off radios if not actively participating in a wireless communication. [Sometimes, these efforts are over-eager and cause their own gnarly confoundings - see e.g. Bluetooth Keyboard Blues.]
So why does does the keyboard act funky now?
This one is simple - you pressed one of the control keys to wake up the laptop - alt, ctrl, shift, window key or menu key. And Windows, in its eagerness to wake up, simply missed the fact you let go of it. It still has it in its sleepy mind that you are holding down that one key - while you are not.
Remedy is simply to press it again.
And it has to be the actual key you pressed. I know, there are two shift keys (or <alt> or <ctrl>), and normally it makes no difference which one you use. But in actuality, they are separate and distinct keys, and are tracked individually by the Operating System. So the left shift pressed to wake the system is discernible from the right shift pressed to wake the system. And, once you've tripped into this confounding, it can only be un-done by pressing the same key again. In essence, the keyboard driver goes - eh? how come I just saw a right shift down transition followed by a right shift up transition? I thought the right shift was already down. That's how I had it in my state machine, anyway. [ so this is why in this case, keys show up uppercase without shift or caps lock - the driver has registered the right shift down press used to get out of sleep, but missed the release key-up code sent in the furor of the system getting out of sleep mode.] And never mind, I now know the right shift key is released and I won't mess with lowercase keys anymore.
Another remedy if a corded keyboard was used is to unplug and re-attach the keyboard. And plugging in a USB keyboard will actually help get you in control again, although the on-board keyboard may stay in the funked up state.
And, seeing as this is Windows, the goto fix out in the world is to re-boot.
But really, all there is to do is to convince the keyboard driver of the true state of the keyboard.