How to Enable Forward and Reverse Buttons on a Gaming Mouse in Debian/Ubuntu Linux
Many gaming mice, like the Alcatroz X-Craft Pro, come with additional buttons such as forward and reverse buttons located near the thumb. While these buttons work out of the box on Windows and macOS, getting them to function properly on Linux systems like Debian or Ubuntu can require some configuration.
In this guide, I’ll show you how to enable and configure these buttons using a tool called imwheel
.
Step 1: Install imwheel
imwheel
is a utility that allows you to remap mouse buttons. To install it, open a terminal and run:
sudo apt update
sudo apt install imwheel
Step 2: Edit the imwheel Configuration File
You need to create or edit the ~/.imwheelrc
file to define how the buttons should behave. Run the following command to open the file in a text editor:
nano ~/.imwheelrc
Paste the following configuration into the file:
".*"
None, Up, Button4, 5
None, Down, Button5, 5
Control_L, Up, Control_L|Button4
Control_L, Down, Control_L|Button5
Shift_L, Up, Shift_L|Button4
Shift_L, Down, Shift_L|Button5
None, Thumb1 , Alt_L|Left
None, Thumb2 , Alt_L|Right
What This Does:
- The last two lines map the lower thumb button (
Thumb1
) to simulate theAlt
key + left arrow (Alt_L|Left
), which is commonly used to navigate backward in browsers. - Similarly, the second thumb button (
Thumb2
) is mapped toAlt
key + right arrow (Alt_L|Right
) for forward navigation.
Step 3: Apply the Configuration
After saving the file, you need to start or restart imwheel
for the changes to take effect. Run:
imwheel -k
To ensure imwheel
starts automatically when you log in, add it to your startup applications:
- Open “Startup Applications” in your desktop environment.
- Click “Add” and enter the following details:
- Name: imwheel
- Command:
imwheel
- Comment: Enable custom mouse button mapping.
- Save the entry.
Step 4: Test the Buttons
Open a browser and use the thumb buttons to navigate backward and forward. If the buttons do not work immediately, you may need to adjust the button numbers or debug your mouse configuration.
Step 5: Debugging Tips
- Use the
xev
command to identify mouse button numbers. Runxev | grep button
and Move your mouse over thexev
window and press the buttons to see their button numbers. - If
imwheel
doesn’t start automatically, ensure the startup command is correct and try running it manually. - If necessary, restart
imwheel
using imwheel -k
Conclusion
With a little configuration, you can unlock the full potential of your gaming mouse on Linux. This guide should help you configure the forward and reverse buttons to work seamlessly for browsing or other applications. Happy computing!
Share this content:
Post Comment