Mapping the mouse backward button in Karabiner for Mac
When using a mouse accessory on a Mac, some people use the Magic Mouse for a perfect fit, while others use third-party Bluetooth mice because of hand discomfort.
Most mouse products like Microsoft or Logitech have side buttons positioned under the thumb, which function as forward and backward buttons in browsers and file explorers on Windows.
When using a mouse with these function buttons, it’s easy to configure if the manufacturer provides drivers. However, in the case of Microsoft, they don’t offer software for macOS, so when you press the fourth or fifth button, it simply registers as a regular click.
If you want to utilize the functionality of a third-party mouse connected to your Mac, you need to map the buttons using Karabiner.
Karabiner is an app that allows customization of inputs for Mac keyboards and mice. It is mainly used for setting shortcuts like switching between English and Korean input.
If you’re a Mac user who transitioned from Windows, you probably have it installed to address a couple of inconveniences. However, if you don’t have it installed, follow the steps below.
- Download and install the Karabiner app from the official website.
- Launch the Karabiner app and grant any necessary permissions.
Mapping Mouse Backward and Forward Buttons on Mac
To map the 4th and 5th buttons on your mouse in Karabiner, you need to know the assigned codes for each button using the mouse event feature. However, you can also map the backward and forward functions using existing presets that are already shared.
- Launch the Karabiner-Elements app.
- Select “Complex Modifications” from the left menu and click on the
- At the bottom of the settings screen, click on the
Import more rules from the Internetbutton.
- Enter “button 4” in the search bar, and from the search results, click the “Import” button next to the source that maps back and forward to buttons 4 and 5.
- Allow opening the source in Karabiner-Elements.app.
- In the Karabiner-Elements app, you can preview the mouse functions of the source. Click the
- Enable the “change button 4, 5 to back, forward” feature and then close the settings window.
✅ You can assign either back or forward to the 4th and 5th mouse buttons based on user convenience.
- Confirm that the mouse keys have been mapped in the Rules section, then click on the Devices menu.
- Activate “Modify events” for the mouse device you want to assign backward and forward functions to.
- After the mapping is complete, open a browser and verify if the backward and forward functions are working.
Although the side buttons on the mouse have been assigned as forward and backward, if you look at the Karabiner rule source, you’ll see that there are sources that allow you to assign specific functions like copy/paste. So feel free to customize it according to your convenience.