Mouse Button Remapper
Remap mouse buttons (side, middle, left, right) to keyboard keys with optional modifiers, double-click actions, a master toggle hotkey and game mode
Author: wygodad

Remaps mouse buttons to keyboard keys, optionally with modifiers (Ctrl,
Shift, Alt, Win). Supported buttons:
- Upper side button = "Forward" (XButton2) — on most mice this is the
side button closer to the front of the mouse.
- Lower side button = "Back" (XButton1).
- Middle button = pressing the scroll wheel.
- Left button and Right button — see the warning below.
Each button has its own on/off switch — when a button is disabled, it
keeps its original function. If your mouse has the side buttons swapped,
simply configure the other one.
The mod runs as a tool mod in a dedicated process and installs a global
low-level mouse hook, so it works system-wide (in every application)
without injecting into the shell or other programs.
Mouse compatibility
By default, on virtually all mice the two side buttons are reported as
standard mouse buttons — Forward (XButton2) and Back (XButton1) —
and the middle button as the wheel click. Those are exactly the events
this mod intercepts, so it works out of the box on a normal mouse with no
vendor software.
However, if the mouse's own software or onboard firmware remaps a button
to a multimedia or keyboard function (e.g. "Refresh", "Play/Pause",
"Browser Back"), that press is no longer sent as a mouse button — it
arrives as a media/keyboard command that a mouse hook cannot see, so this
mod can no longer remap it. If a button is not being intercepted, open
your mouse software and set it back to the plain Forward / Back /
Wheel click function, then assign the keyboard key here in the mod.
In other words: let the mouse send a normal button, and let the mod do
the remapping — do not remap the same button in both places.
Configuration
Each button has its own section in the mod settings:
-
Enabled — the master switch for that button. When unchecked, the
button behaves exactly as the manufacturer intended and all other
fields in the section are ignored. This lets you remap only one button
and leave the rest untouched.
-
Key — the keyboard key sent while the button is held. Pick one
from the dropdown (F1–F12, Enter, Esc, arrows, media keys, …). The
key press mirrors the button press: key-down when you press the
button, key-up when you release it. The original button action is
suppressed only when the remap is active.
-
Custom key — used only when Key is set to
Custom (use field below). It lets you type any key the dropdown
does not list. Accepted values:
F1 … F24
- single letters and digits:
A … Z, 0 … 9
- named keys:
Enter, Esc, Tab, Space, Backspace, Delete,
Insert, Home, End, PageUp, PageDown, Up, Down,
Left, Right, PlayPause, Mute, VolumeUp, VolumeDown
- any Windows virtual-key code in hex, e.g.
0x74 (= F5) — see the
"Virtual-Key Codes" page in Microsoft docs for the full list
- a full combo such as
Ctrl+F5 or Ctrl + Shift + T — modifiers
typed here are combined with the Modifier dropdown selection
If the value cannot be parsed, the remap is inactive and the button
keeps its original function (a note is written to the mod's log,
visible via "Show log" in Windhawk).
-
Modifier — keys held together with the main key, e.g. selecting
Ctrl with key F5 sends Ctrl+F5 (hard refresh in browsers).
-
Double-click action — optionally send a different key on
double-click (e.g. single click = F5, double click = Ctrl+Shift+T).
The double-click key/custom key/modifier fields work exactly like the
single-click ones. Note: while this is enabled, the single-click
action fires only after the system double-click interval passes
without a second click, so it has a short delay; press-and-hold
mirroring is also disabled for that button. When disabled (default),
single clicks are instant.
Changes are applied immediately after saving the settings — no restart
needed.
Master toggle hotkey
An optional global keyboard shortcut that suspends/resumes all remaps at
once — handy when the buttons' original functions are temporarily
needed. Pick the modifiers and the key from the dropdowns; if the chosen
combination is already taken by another application, the registration
fails and a note is written to the mod's log — just pick a different
combination. Every toggle shows a short on-screen indicator
("Mouse remap: ON/OFF"); a confirmation sound can be enabled with the
"Play a sound on toggle" option. The indicator scales with the screen
and appears on the monitor under the cursor, so it stays readable on
large / high-resolution displays. Remapping always starts active after
the mod (re)starts.
Troubleshooting: if pressing the shortcut only produces a plain
system beep and no on-screen indicator, the shortcut did not get
registered. Open the mod's log (Show log in Windhawk) and look for a
"RegisterHotKey failed" line — error 1409 means another application
already owns that combination; pick a different one and save again.
Game mode
When enabled, remapping is automatically suspended while the foreground
window covers the entire screen — typical for games and fullscreen
video. Note that this also applies to browsers in fullscreen (F11) mode.
The fullscreen state is tracked efficiently: instead of being recomputed
inside the mouse hook on every click, it is cached and only refreshed via
window events (foreground change and window move/resize) while game mode
is enabled, so the hook stays lightweight.
⚠️ Warning: left and right button
Remapping the left button disables normal clicking system-wide while
enabled — you will not be able to click anything with it, including the
Windhawk window. Keep keyboard navigation in mind (Tab/Enter), or simply
disable the mod from Windhawk using the keyboard if you lock yourself
out. Remapping the right button similarly removes access to context
menus (the keyboard Menu key still works). Both are disabled by default;
enable them only if you know what you are doing.
Mouse Button Remapper (polski)
Mod przemapowuje przyciski myszy na klawisze klawiatury, opcjonalnie z
modyfikatorami (Ctrl, Shift, Alt, Win). Obsługiwane przyciski: górny
boczny (Do przodu / XButton2), dolny boczny (Wstecz / XButton1),
środkowy (klik kółka) oraz — z ostrzeżeniem poniżej — lewy i
prawy. Mod działa jako „tool mod" w osobnym procesie i instaluje
globalny hook myszy, więc działa we wszystkich aplikacjach bez
wstrzykiwania się do powłoki ani innych programów.
Zgodność myszek
Domyślnie w praktycznie każdej myszce dwa boczne przyciski są zgłaszane
jako standardowe przyciski myszy — Do przodu (XButton2) i Wstecz
(XButton1) — a środkowy jako klik kółka. Dokładnie te zdarzenia mod
przechwytuje, więc na zwykłej myszce bez oprogramowania działa od razu.
Jeśli jednak oprogramowanie myszki lub jej firmware przypisze przyciskowi
funkcję multimedialną lub klawiaturową (np. „Refresh", „Play/Pause",
„Wstecz przeglądarki"), takie naciśnięcie nie jest już wysyłane jako
przycisk myszy — przychodzi jako komenda multimedialna/klawiatury, której
hook myszy nie widzi, więc mod nie może go przemapować. Jeśli któryś
przycisk nie jest przechwytywany, w oprogramowaniu myszki ustaw go z
powrotem na zwykłe Do przodu / Wstecz / klik kółka, a klawisz
przypisz tutaj w modzie. Krótko: niech myszka wysyła normalny przycisk, a
przemapowaniem zajmie się mod — nie mapuj tego samego przycisku w obu
miejscach naraz.
Konfiguracja
Każdy przycisk ma własną sekcję:
-
Włączony — główny włącznik. Gdy odznaczony, przycisk działa tak,
jak ustawił producent, a pozostałe pola są ignorowane. Dzięki temu
można przemapować tylko jeden przycisk, a resztę zostawić.
-
Klawisz — klawisz wysyłany podczas trzymania przycisku, wybierany
z listy (F1–F12, Enter, Esc, strzałki, klawisze multimedialne, …).
Wciśnięcie klawisza odwzorowuje wciśnięcie przycisku: key-down przy
naciśnięciu, key-up przy puszczeniu.
-
Klawisz niestandardowy — używany tylko, gdy Klawisz =
Niestandardowy (pole poniżej). Akceptuje:
F1 … F24,
- pojedyncze litery i cyfry:
A … Z, 0 … 9,
- nazwy:
Enter, Esc, Tab, Space, Backspace, Delete,
Insert, Home, End, PageUp, PageDown, Up, Down,
Left, Right, PlayPause, Mute, VolumeUp, VolumeDown,
- dowolny kod virtual-key w hex, np.
0x74 (= F5) — pełna lista na
stronie "Virtual-Key Codes" w dokumentacji Microsoftu,
- pełną kombinację, np.
Ctrl+F5 albo Ctrl + Shift + T —
modyfikatory wpisane tutaj sumują się z dropdownem Modyfikator.
Jeśli wartości nie da się sparsować, bind jest nieaktywny i przycisk
zachowuje oryginalną funkcję (informacja trafia do logu moda —
"Show log" w Windhawk).
-
Modyfikator — klawisze trzymane razem z głównym klawiszem, np.
Ctrl + klawisz F5 wysyła Ctrl+F5 (twarde odświeżenie strony).
-
Akcja podwójnego kliknięcia — opcjonalnie inny klawisz przy
dwukliku (np. pojedyncze kliknięcie = F5, podwójne = Ctrl+Shift+T).
Pola klawisza/klawisza niestandardowego/modyfikatora dwukliku
działają tak samo jak dla pojedynczego kliknięcia. Uwaga: gdy ta
opcja jest włączona, akcja pojedynczego kliknięcia wykonuje się
dopiero po upływie systemowego czasu dwukliku (krótkie opóźnienie),
a odwzorowanie przytrzymania przycisku jest dla niego wyłączone.
Gdy opcja jest wyłączona (domyślnie), pojedyncze kliknięcia działają
natychmiast.
Zmiany działają natychmiast po zapisaniu ustawień — bez restartu.
Skrót włączania/wyłączania bindów
Opcjonalny globalny skrót klawiszowy, który jednym naciśnięciem
wstrzymuje/wznawia wszystkie bindy — przydatny, gdy chwilowo potrzebne
są oryginalne funkcje przycisków. Modyfikatory i klawisz wybierasz z
list — jeśli kombinacja jest już zajęta przez inny program, rejestracja
się nie powiedzie, a informacja trafi do logu moda — wystarczy wybrać
inną kombinację. Każde przełączenie pokazuje krótki wskaźnik na ekranie
("Mouse remap: ON/OFF"); dźwięk potwierdzenia można włączyć opcją
„Odtwarzaj dźwięk przy przełączeniu". Wskaźnik skaluje się do rozmiaru
ekranu i pojawia się na monitorze pod kursorem, więc pozostaje czytelny
na dużych ekranach i wysokiej rozdzielczości. Po (re)starcie moda bindy
są zawsze aktywne.
Rozwiązywanie problemów: jeśli naciśnięcie skrótu daje tylko zwykły
systemowy „ding" i wskaźnik się nie pokazuje, skrót nie został
zarejestrowany. Otwórz log moda (Show log w Windhawk) i poszukaj linii
"RegisterHotKey failed" — błąd 1409 oznacza, że kombinację zajmuje już
inna aplikacja; wybierz inną i zapisz ponownie.
Tryb gry
Gdy włączony, bindy są automatycznie wstrzymywane, dopóki okno na
pierwszym planie zajmuje cały ekran — typowe dla gier i pełnoekranowego
wideo. Uwaga: dotyczy to też przeglądarki w trybie pełnoekranowym (F11).
Stan pełnego ekranu jest śledzony wydajnie: zamiast przeliczać go w haku
myszy przy każdym kliknięciu, jest buforowany i odświeżany tylko przez
zdarzenia okien (zmiana aktywnego okna oraz zmiana rozmiaru/pozycji),
i tylko gdy tryb gry jest włączony — dzięki czemu hak pozostaje lekki.
⚠️ Ostrzeżenie: lewy i prawy przycisk
Przemapowanie lewego przycisku blokuje normalne klikanie w całym
systemie — nie klikniesz nim niczego, łącznie z oknem Windhawka. W razie
zablokowania użyj nawigacji klawiaturą (Tab/Enter) albo wyłącz mod w
Windhawku klawiaturą. Przemapowanie prawego przycisku odbiera dostęp
do menu kontekstowych (działa jeszcze klawisz Menu na klawiaturze). Oba
są domyślnie wyłączone — włączaj tylko świadomie.