Here is my first attempt to write this question while I had the issue. Because of the issue, I was unable to click on the post question button:
I just woke my computer from sleep and my keyboard is not behaving.
For example, the modifier keys are reversed so pressing arrow left highlights text rather than moving the cursor. I also have my Caps Lock key reversed, and I get a
<when I try to type a comma and a
>when I type a fullstop, yet holding or not holding Shift does not correct this.
I have tried unplugging the keyboard and plugging it back in using a different USB port with no improvement.
In the past, the only solution I've found is to reboot the system. Else I'm stuck holding Ctrl to click on links so they don't open in new windows, etc.
After restarting my computer I'm tempted to put the punctuation in above. Basically, all the modifier keys Ctrl, Alt, Shift, Caps Lock had been reversed so that the lights and the key combinations did not work as expected, and using my computer became far more difficult. For example, I could click on some text, and click elsewhere, and it would select everything inbetween as if I had held the Shift key.
This has happened several times and always when I've woke my computer from sleep.