Wednesday, January 1, 2014

X-Mouse for Windows 7 and Windows 8

Many years ago I used Sun workstation computers with a user interface based on X-Windows. One feature of X-Windows that I found very useful is focus-follows-mouse. With this feature enabled, the window on which the mouse pointer rested automatically got keyboard focus, but without coming to the front, as shown in this video:

The Windows Ease of Access Center (find it in the Control Panel) provides a way to make the keyboard focus follow the mouse pointer. Click the "Make the mouse easier to use" link and then check the "Activate a window by hovering over it with the mouse" checkbox.

This can get you part way there, but if you enable X-mouse style behavior this way you get the unfortunate side effect that when a window gets focus, it also comes to the front.

To get the true X-mouse behavior requires a registry tweak. The registry key of interest is HKEY_CURRENT_USER\Control Panel\Desktop.
  1. Edit the UserPreferencesMask value, changing the first two bytes to 9F 3E.
  2. Create a new REG_DWORD item named ActiveWndTrkTimeout. Its value is the time delay in milliseconds after the mouse pointer enters a window before it receives focus. In my demo video I have the value set to 200 decimal. Set the value to whatever works best for you. A value of zero will cause you to have trouble with pop-up and drop-down controls like drop-down lists and calendar date selectors.
  3. Log out or reboot your computer for the changes to take effect. Logging out might be sufficient but I'm not sure about this.
Update (2014-08-13): Logging out is sufficient to make the registry change take effect; reboot is not required.