Very infrequently, a very strange thing starts happening, seemingly without cause. At first, it seems as though my keyboard has broken, but replugging has no effect, and bringing up OS X's keyboard viewer DOES display keypresses.
However, nothing is inputted to the system or any text fields. In fact, clicking with the mouse on individual keys in the keyboard viewer also has no effect.
Logging out and logging back in fixes whatever the problem was. How would I go about troubleshooting this, should it happen again?