Skip to content

Instantly share code, notes, and snippets.

@anshumanb
Last active January 24, 2026 22:12
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

The following instructions have only been tested on Windows 10.

Enable "Focus follows mouse"

  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.

Stop windows being brought to front on focus

Once "Focus follows mouse" is enabled, you may find it helpful to prevent windows from being brought to front on focus:

  1. In the registry editor, navigate to Computer\HKEY_CURRENT_USER\Control Panel\Desktop.
  2. Update ActiveWndTrkTimeout to 300.
  3. Update UserPreferencesMask by subtracting 40 bits from the first hex value e.g. DF -> 9F.
  4. Log out and log back in.

Source

PS: These instructions are terse. For more detailed steps, check out @erbanku's comment.

@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!

@anshumanb
Copy link
Author

@abstractionmage Done. Thank you for pointing that out.
@erbanku Thanks for the update. Have linked to it from the gist.

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