Behind the scenes
I made my MacBook's trackpad talk
By Tonnoz4 min read
Your MacBook's trackpad doesn't actually click. The glass doesn't move. Under it there's a small haptic motor that taps your finger at the right moment, and your brain fills in the click. Turn the Mac off and press the trackpad: nothing happens, because there's no button down there.
A motor that can tap fast enough to fake a click can also tap a few hundred times a second, and at that speed the glass starts making sound. So SlapMac 1.7 has a new page called Trackpad Speaker, and yes, your trackpad talks now.
How can a trackpad make sound?
A speaker is a thing that moves back and forth quickly and pushes air around. The trackpad motor does the same, only it was built to move once per click. If you send it a 440 Hz tone, the glass vibrates 440 times a second and you hear an A. It's quiet, so you'll hear it best in a quiet room, but it's clearly there.
I didn't come up with this. A developer called os6 published nospeaker, a little MIT-licensed Swift program that makes the trackpad say things, and I had to try it. SlapMac's version started from that code. It uses the same private macOS framework that runs the trackpad, and then adds the parts you need before putting it in an app lots of people run: a page to play with it, limits, cool-downs and a lot of testing.
What can it do?
Open SlapMac from the menu bar and pick Trackpad Speaker…. There are three things to try.
Talk is the fun one. Type a line, up to 140 characters, and the trackpad says it. SlapMac uses your Mac's own voice to speak the line into memory (it never touches your speakers and never writes a file), works out the pitch and the shape of each sound, and plays that as two tones on the motor. It sounds like a robot that swallowed a bee, but you can follow it. The default line is "Hello. I'm your trackpad. Screw speakers." and I stand by it.
Instrument turns the trackpad into a weird little synth. Slide a finger left and right for notes, up for vibrato, and press with more of your finger to play louder. The pointer still moves while you play, which is confusing for about ten seconds and then very fun.
The tests are a sweep from low to high, a single tone and a chime, so you can hear what the motor can do before you start making it talk.
It's hard to believe the sound isn't coming from the speakers, so the page has a Mute Speakers button. Mute, play, and show it to someone who doesn't believe you.
Can it break the trackpad?
This was the first thing I wanted to know. Nobody outside Apple knows for sure. Apple doesn't document how long or how hard that motor can run. I looked for reports of software damaging it and didn't find any. What I did find is that if you push it past its normal strength, the haptic driver stalls. Run any coil long enough and it also gets warm.
So SlapMac plays it safe:
- It never drives the motor past its normal maximum strength, and keeps every tone between 100 Hz and 4 kHz, the range the motor handles well.
- Each playback stops after 15 seconds, and the motor rests before the next one.
- It plays for at most 60 seconds in any 5 minutes. When that's used up, the page tells you how long until it's ready again.
These limits are tested in code and SlapMac checks them before every single tap. They come from me, not from Apple, and the feature uses a framework Apple doesn't support, so a macOS update could change how it behaves. If you'd rather not risk your trackpad, don't use it. It's off unless you open the page and press play. The details are in the terms.
What else does it do?
There are two small extras on the same page, and both are off by default.
Feel Slaps makes the trackpad thump back every time you slap your MacBook. Your slap sound still plays, and on top of it you feel a quick knock under your finger, harder for harder slaps. It's a tiny thing, but it makes the slap feel like it landed somewhere.
The other one is for people who use Claude Code. With slapmod, my free Claude Code mod, the trackpad says "Claude is done." when a long answer finishes and "Claude needs you." when Claude stops to ask for permission. It works with your Mac muted, so Claude can call you from under your hand while the speakers stay quiet. You need slapmod 0.5.0 or newer, and the switch is at the bottom of the Trackpad Speaker page. If you want to know what else slapmod does, I wrote about it in how to stop Claude Code by slapping your MacBook.
Which Macs does it work on?
Any Mac with a Force Touch trackpad: MacBooks from 2015 on, or a Magic Trackpad 2 or newer on a desktop Mac. The page checks for you and says so if your trackpad has no motor. You need SlapMac 1.7 or newer.
I'm already thinking about what else the trackpad could do, so if you have an idea, there's a "Got an idea for the Trackpad Speaker?" link at the bottom of the page that emails me straight away. And go easy on it. It was only ever supposed to click.