Quick fix: Windows 11 doesn’t expose per-button mouse remapping natively. PowerToys (free, from Microsoft) includes a Keyboard Manager that remaps keys, but for mouse buttons specifically, use the registry under HKCU\Software\Classes\… with custom shell verbs, or accept that PowerToys+AutoHotkey is the closest to “built-in.”
You want Mouse Button 5 to send Ctrl+W (close tab) instead of its default Browser Forward. Logitech Options or Razer Synapse can do this for their own mice, but you have a generic OEM mouse without vendor software. Windows itself has no per-button remap UI. You want it without installing a third-party tool — or with only Microsoft-provided tools.
Affects: Windows 11 with generic (non-vendor-software) mice.
Fix time: 10 minutes.
What Windows actually exposes
Windows’ built-in mouse controls cover button swap (left/right), wheel direction, and pointer speed. Per-button remap requires interception at the HID layer, which Windows doesn’t expose to user-mode without an explicit driver. The closest “built-in” option is Microsoft’s PowerToys, which technically isn’t in Windows by default but is published by Microsoft and acts like a first-party tool.
Method 1: Use PowerToys Keyboard Manager (with caveats)
- Install PowerToys from
github.com/microsoft/PowerToysor from Microsoft Store. - Open PowerToys → Keyboard Manager.
- Note: Keyboard Manager remaps keys, not mouse buttons. For mouse-side remap, you need the Mouse Without Borders or wait for native mouse remap (still requested).
- For mouse buttons specifically, see Method 2.
This caveat is important: Keyboard Manager is what most online guides point to, but it doesn’t actually handle mouse buttons. Move to AutoHotkey.
Method 2: Use AutoHotkey (lightweight scripting)
AutoHotkey is small (~3 MB), open source, and the standard tool for input remapping on Windows.
- Download AutoHotkey v2 from
autohotkey.com. Install. - Create a script
C:\Scripts\mouse-remap.ahk:
#Requires AutoHotkey v2.0
XButton2::^w
(This makes Mouse Button 5 (XButton2) send Ctrl+W.) - Right-click the script → Open with AutoHotkey. The script is now running.
- To make it run at login: put a shortcut to the .ahk file in
%AppData%\Microsoft\Windows\Start Menu\Programs\Startup. - Test by pressing XButton2 in a browser — closes the active tab.
AutoHotkey scripts are 1-line for simple remaps. Multi-button setups are still concise.
Method 3: Registry-based command remap
For specific apps, Windows has app-specific shell command remaps that can be triggered by mouse buttons via accessibility shortcuts. This is fragile and rarely used.
- For browser-specific remaps, use the browser’s extension store — many extensions remap mouse buttons within the browser only.
- For system-wide custom shortcuts, Windows offers Quick Assist’s app shortcuts (Win+1 through Win+0 for taskbar apps), but those bind to keyboard, not mouse.
- For Surface devices with stylus buttons, Pen Settings has per-app behaviors — not applicable to standard mice.
There’s no clean registry-only path for general mouse remap on Windows 11. The honest answer is that AutoHotkey (Microsoft-recognized but not built-in) is the closest to native.
How to verify the fix worked
- Press the remapped button in an app that supports the target keyboard shortcut. The shortcut fires.
- Open Task Manager. AutoHotkey.exe is running.
- The remap script appears in the system tray.
- Reboot and confirm the script auto-starts.
If none of these work
If AutoHotkey doesn’t intercept the button, the button may not be a standard HID-class XButton — some mice with extra buttons require their vendor driver to expose those buttons to Windows at all. In that case, install the vendor driver minimally and use its remap. For users who refuse all third-party tools, the right answer is “Windows 11 doesn’t support it” — submit feedback via the Feedback Hub. For chronic remap needs, consider buying a mouse with on-board profile memory (Logitech G/MX series, Razer Basilisk) so remaps are stored in the mouse hardware itself.
Bottom line: Windows has no native mouse-button remap. PowerToys doesn’t cover this. AutoHotkey is the practical answer for a near-native experience without committing to vendor software.