How to troubleshoot sudden text input failure?

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?


Solution 1:

  • Open /Applications/Utilities/Console.app and look for relevant messages.
  • Log in to your Mac using a remote desktop software (e.g. VNC) and see if key presses work from there
  • Run ps aux in Terminal (/Applications/Utilities/Terminal.app) and look for suspicious processes.
  • Disable all processes that run in the background, including:
    • processes started when you log in (Accounts preference pane),
    • started from third party System Preferences panes (~/Library/PreferencePanes etc.),
    • launchd property lists in */Library/LaunchAgents and */Library/LaunchDaemons
  • Uninstall all third party kernel extensions from /System/Library/Extensions
  • Remove all input managers from */Library/InputManagers
  • Log in to another user and check to see if that account is also affected (including the Login Window itself)
  • Run sudo fs_usage -f filesys in Terminal to see whether some files are accessed very frequently
  • Change the keyboard layout in Language & Text preference pane
  • Toggle support for assistive devices in Universal Access preference pane
  • Check if some options in Universal Access preference pane are enabled, e.g. slow keys
  • Use a virtual keyboard or AppleScript to emulate key presses and check if they get through.