Remapping Logitech Mouse Buttons on Linux Mint (G502 and Similar)
- Brady Loenhart
- January 21, 2026
- 4 mins
- Technical Guides
- hardware input remapper linux linux mint logitech mouse peripherals solaar
If you’ve tried to remap the extra buttons on a Logitech gaming mouse in Linux, you may have hit a wall. You press a thumb button expecting to capture a button code, but your system receives Ctrl+Shift+C instead. Remapping tools can’t help because they never see the original button press.
This guide explains why this happens and provides a clean two-tool solution.
The Problem: Macros Stored in Mouse Firmware
Logitech gaming mice have onboard memory that stores button configurations. If the mouse was ever used with Logitech G Hub on Windows, those macros are burned into the firmware. The mouse itself sends keyboard combinations—Linux never sees the button press.
The symptom: Pressing G4 opens a terminal window (because it’s sending Ctrl+Shift+C, a common terminal shortcut) instead of doing what you configured.
The Solution: Two Tools
| Tool | Purpose |
|---|---|
| Solaar | Disable onboard profiles so buttons send raw codes |
| input-remapper | Remap the raw button codes to your desired shortcuts |
That’s it. You don’t need ratbagd, piper, xbindkeys, or anything else.
Step 1: Diagnose the Problem
First, confirm buttons are sending macros instead of raw codes.
Find your mouse’s event device:
cat /proc/bus/input/devices | grep -A 5 "G502\|Logitech"
Logitech mice create two interfaces—a Mouse interface and a Keyboard interface. Note the event numbers (e.g., event13 for mouse, event14 for keyboard).
Test the mouse interface:
sudo evtest /dev/input/event13
Press your extra buttons. If you see raw codes like this, skip to Step 3:
Event: type 1 (EV_KEY), code 275 (BTN_SIDE), value 1
If nothing appears, check the keyboard interface:
sudo evtest /dev/input/event14
If buttons produce keyboard events like this, you have the onboard macro problem:
Event: type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1
Event: type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: type 1 (EV_KEY), code 46 (KEY_C), value 1
Step 2: Disable Onboard Profiles
One command fixes the macro problem:
solaar config "G502 HERO Gaming Mouse" onboard_profiles Disabled
Find your exact device name with solaar show if needed.
Why this works: Disabling onboard profiles tells the mouse to stop executing stored macros and send raw button codes instead.
Verify It Worked
Run evtest on the mouse interface again:
sudo evtest /dev/input/event13
Now you should see raw button codes:
Event: type 1 (EV_KEY), code 275 (BTN_SIDE), value 1
Event: type 1 (EV_KEY), code 276 (BTN_EXTRA), value 1
Event: type 1 (EV_KEY), code 278 (BTN_BACK), value 1
Event: type 1 (EV_KEY), code 279 (BTN_TASK), value 1
Note which button produces which code—you’ll need this for remapping.
Step 3: Set Up input-remapper
Fix Permissions
input-remapper needs access to input devices:
sudo usermod -aG input $USER
Log out and back in for this to take effect. Without this, you’ll get “Device was not grabbed” errors.
Configure Mappings
Launch the GUI:
input-remapper-gtk
- Select your mouse from the dropdown
- Create a new preset (e.g., “copy-paste”)
- For each mapping:
- Click Record and press the mouse button
- Type the output (e.g.,
Control_L+cfor Ctrl+C)
- Click Apply
Example mappings:
| Button | Output Symbol | Result |
|---|---|---|
| G4 | Control_L+Shift_L+c | Terminal copy |
| G5 | Control_L+Shift_L+v | Terminal paste |
| G7 | Control_L+c | Copy |
| G8 | Control_L+v | Paste |
Enable at Startup
input-remapper-control --command autoload
Troubleshooting
Buttons still send keyboard macros
The Solaar setting may have reset. Verify with:
solaar config "G502 HERO Gaming Mouse" onboard_profiles
“Device was not grabbed”
You’re not in the input group or haven’t logged out:
groups $USER # Should include 'input'
GUI shows Python errors
Some input-remapper versions have display bugs. If the output says “is currently mapped,” your config is active—test the buttons despite the errors.
Button codes differ from this guide
Codes vary by mouse model. Always verify with evtest on your specific device.
Quick Reference
# 1. Diagnose
sudo evtest /dev/input/event13 # Find event number first
# 2. Disable onboard profiles
solaar config "G502 HERO Gaming Mouse" onboard_profiles Disabled
# 3. Verify raw codes now appear
sudo evtest /dev/input/event13
# 4. Add to input group (one time)
sudo usermod -aG input $USER
# Log out and back in
# 5. Configure remapping
input-remapper-gtk
# 6. Enable autostart
input-remapper-control --command autoload
Why This Approach
ratbagd/piper is another valid solution—it configures button macros directly in the mouse firmware, so they work on any computer without extra software. If you’re not already using Solaar and want firmware-level configuration, piper (the GUI for ratbagd) is worth considering.
However, if you already have Solaar running (common for DPI settings or battery monitoring), it can silently override ratbagd changes when onboard profiles are enabled. I spent time configuring ratbagd before discovering Solaar was undoing everything.
The Solaar + input-remapper approach worked for me because:
- I already had Solaar installed for DPI control
- One Solaar command disables the problematic onboard profiles
- input-remapper handles remapping at the OS level, which is flexible and easy to change
If you’re starting fresh with no tools installed, either path works. But if Solaar is already in the picture, this guide avoids the tool conflict entirely.
Based on troubleshooting a G502 HERO on Linux Mint where buttons were sending Ctrl+Shift+C/V from Windows G Hub configuration.