Skip to content

Instantly share code, notes, and snippets.

@anshumanb
Created July 20, 2021 05:54
Show Gist options
  • Select an option

  • Save anshumanb/19b2ae62f8fbad8138efb571bbe163b1 to your computer and use it in GitHub Desktop.

Select an option

Save anshumanb/19b2ae62f8fbad8138efb571bbe163b1 to your computer and use it in GitHub Desktop.
Set up focus follows mouse on Windows 10
  1. Navigate to Control Panel > Ease of Access > Ease of Access Center > Make the mouse easier to use
  2. Check "Activate a window by hovering over it with the mouse" and hit OK
  3. In the registry editor, navigate to Computer\HKEY_CURRENT_USER\Control Panel\Desktop
  4. Update ActiveWndTrkTimeout to 300
  5. Update UserPreferencesMask by subtracting 40 bits from the first hex value e.g. DF -> 9F
  6. Log out and log back in

Source: https://winaero.com/enable-xmouse-window-tracking-windows-10/

@abstractionmage
Copy link

abstractionmage commented Jul 27, 2025

Step 1 and 2 seem to be enough to enable focus follows mouse. Everything else just prevents windows from being brought to the front if you hover your mousr over them. Would you mind adding this as context to your guide @anshumanb?

@erbanku
Copy link

erbanku commented Oct 24, 2025

Enable Xmouse (Focus Follows Mouse) in Windows

  1. Press Win + R, paste control.exe /name Microsoft.EaseOfAccessCenter into the Run dialog, and press Enter. In the window that opens, click on “Make the mouse easier to use”.

  2. Check the box for “Activate a window by hovering over it with the mouse” and click OK.

    This enables focus-follows-mouse with a default hover delay.

  3. To customize the behavior, press Win + R, type regedit, and press Enter to open the Registry Editor. Navigate to the following path:
    HKEY_CURRENT_USER\Control Panel\Desktop

  4. In the right-hand pane, find and double-click UserPreferencesMask. To prevent windows from automatically rising to the front when they gain focus, subtract 40 from the first two characters of the value. For example, if the value is DF, change it to 9F.

  5. Next, find the ActiveWndTrkTimeout value. If it doesn't exist, create it by right-clicking in the right-hand pane, selecting New → DWORD (32-bit) Value, and naming it ActiveWndTrkTimeout.

    • Double-click it, select the Decimal base, and set its value to the desired delay in milliseconds (e.g., 300 for 300ms or (hex: 12C)).
  6. Sign out of Windows and sign back in for the changes to take effect.

@erbanku
Copy link

erbanku commented Oct 24, 2025

@anshumanb It works, thank you!
@abstractionmage I helped update the guide!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment