Mouse buttons 4 and 5 for back and forward on a Mac
macOS has no setting that makes the side buttons on a mouse, buttons 4 and 5, go back and forward. System Settings covers your mouse’s speed and scrolling but has no list of extra buttons to assign, so whether the side buttons do anything is left to each app. Trill fixes it with one switch: its Everyday Gesture Set makes button 4 go back and button 5 go forward in Safari, Chrome, Arc, Firefox, Edge, Brave, Orion and Finder, and leaves the buttons untouched in every other app. It works on a Mac with no trackpad at all.
If you would rather not install anything, the keyboard does the same job: Command-[ goes back and Command-] goes forward in Safari and Finder.
Which buttons are 4 and 5
Mouse buttons are numbered. Button 1 is the primary (left) button, 2 is the secondary (right) button, and 3 is the middle button, which on most mice is a press of the scroll wheel. Buttons 4 and 5 are the two extra buttons that many mice put on the side, under your thumb. By convention 4 is back and 5 is forward, and the back button is usually the one nearer your wrist.
These are buttons on third-party mice, connected by Bluetooth, a USB receiver or a cable. Apple’s Magic Mouse has no side buttons, so there is nothing here to set up on one.
What macOS does with them on its own
Open System Settings and click Mouse, and you will find tracking speed, scrolling, natural scrolling and the secondary click. There is no list of buttons and no way to give button 4 or 5 a job. macOS passes the presses on to whichever app is in front, and each app decides for itself.
In practice that means some apps respond to the side buttons and many ignore them. The common result is a back button that works in one browser and does nothing in another, or does nothing in Finder, which is exactly where you want it while digging through folders.
Until you set something up, there are three built-in ways round it:
- The keyboard. Command-[ goes back and Command-] goes forward in Safari and in Finder, and most browsers use the same pair.
- The toolbar. Safari and Finder windows have back and forward arrows in the toolbar. Slower, but always there.
- The trackpad. If you also have a trackpad, Swipe between pages (System Settings, then Trackpad, then More Gestures) lets a two-finger swipe left or right go back and forward in Safari.
Some mouse makers offer their own software that can map the side buttons. That is a separate install for each brand, and it may or may not cover your model.
Setting it up with Trill
Trill is a menu bar app for trackpad gestures, keyboard shortcuts with a Hyper Key, and window snapping. Mouse buttons are part of its Everyday Gesture Set, which is switched on with one click.
- Download Trill and open it. It runs on macOS 14 Sonoma or later, on Apple silicon and Intel Macs.
- Switch on the Everyday Gesture Set. Trill’s welcome suggests the sets that suit the apps already on your Mac.
- When macOS asks, allow Accessibility. Trill needs it to press keys and clicks for you, and macOS asks only once. If you skip it, Trill’s menu says “Trill can’t press keys or move windows yet” and offers Allow Accessibility. You can also switch Trill on yourself in System Settings, under Privacy & Security, then Accessibility.
- Test it in a browser. Open a page, follow two links, then press button 4 twice. You should be back where you started. Press button 5 to go forward again.
- Test it in Finder. Open a folder, then a folder inside it, then press button 4. The window goes back to the first folder.
Trill is free for 24 hours from the first launch, with every feature and no card needed, which is plenty of time to try it with your own mouse. After that it is $29 once, not a subscription, and one licence key works on up to 3 Macs.
The Everyday set also makes a three-finger tap on the trackpad a middle click, which opens a link in a new tab in a browser. How to middle click on a Mac trackpad covers that half of the set, including what happens if you have set macOS to use a three-finger tap for Look Up.
Why only browsers and Finder
The Everyday set’s back and forward work only in the seven browsers named above and in Finder. In every other app, Trill lets buttons 4 and 5 pass through untouched. The app receives the press exactly as your mouse sent it, as if Trill were not running.
That is deliberate. Trill goes back and forward by pressing Command-[ and Command-] for you, and those keys mean back and forward only in browsers and Finder. In many other apps they edit what you are working on: code editors shift the line, and Pages and Notes change the indent. So an app that gives the side buttons a job of its own keeps that job, an app that ignores them carries on ignoring them, and nothing changes behind your back in apps you did not think about.
Two more controls help when an app wants your input to itself:
- Ignore these apps. Trill is off while any app on this list is in front. It is meant for games, remote desktops and virtual machines, where you want every button and key to reach the app, or the other computer, unchanged.
- Pause. From the menu bar you can pause Trill for 15 minutes, for 1 hour, or until you resume. Useful for a one-off, such as a screen share where someone else is driving.
Giving the buttons other jobs
Back and forward is only the ready-made use. To give button 4 or 5 a different job, open the Everyday set in Trill and press Edit on the Mouse button 4 or Mouse button 5 row. Trill makes the row your own copy (the set’s original is turned off), and you can change what the button does and which apps it works in.
Two limits are worth knowing. New gesture listens to the trackpad, so it cannot hear a mouse button; editing the Everyday rows is the way in. And button 3, the scroll-wheel press, is not in any of Trill’s sets, so Trill leaves it alone.
Trill has more than a hundred actions to pick from. A few that suit a thumb button:
- Mission Control, App Exposé or Show Desktop, for getting around a crowded screen without reaching for the keyboard.
- Next or previous tab, in an app where you switch tabs all day.
- Play or pause, or volume up and down, for music while you work.
- Any keyboard shortcut, so a button can press a key combination you use constantly in one app.
If you would rather widen back and forward to another app, check first that Command-[ goes back there, since that is the key Trill presses.
Where BetterTouchTool fits
If you are reading about mouse buttons, you may also have come across BetterTouchTool. It customises trackpad gestures, the mouse, keyboard shortcuts and much more, and its device list is far longer than Trill’s: mouse buttons and Logitech devices, the Magic Mouse, the Touch Bar, Stream Deck and other macro pads, game controllers and MIDI controllers, among others. If you want one app that reaches every input device you own, BetterTouchTool does far more than Trill, costs less at the time of writing (October 2026), and one licence covers all your personal Macs.
Trill is for a narrower job: your trackpad, your keyboard and the two buttons under your thumb, with back and forward ready after one click.
Questions
Why does my back button work in one app but not another?
macOS does not assign the side buttons, so each app decides whether to respond, and the answer varies from app to app. With Trill’s Everyday set on, they go back and forward in Safari, Chrome, Arc, Firefox, Edge, Brave, Orion and Finder, whatever the app does on its own.
Does this work with Apple’s Magic Mouse?
The Magic Mouse has no side buttons, so there are no buttons 4 and 5 to set. Trill does not add Magic Mouse gestures either.
Will Trill change what the side buttons do in my games?
No. Outside browsers and Finder, the Everyday set leaves buttons 4 and 5 untouched. If you want Trill off completely while a game is in front, add the game to Ignore these apps.
Do I need a trackpad for this?
No. Trill’s gestures need a trackpad, but mouse buttons 4 and 5, keyboard shortcuts and window snapping work on a Mac with only a mouse. Trill still needs Accessibility to read the buttons.
Is there a keyboard shortcut for back and forward?
Yes. Command-[ goes back and Command-] goes forward in Safari and Finder, and most browsers use the same keys.