macOS 26.2+ · menu-bar app · MIT

One Magic Trackpad. Two Macs. Zero re-pairing.

Lock the Mac you’re on and the trackpad is on the other one about 3 seconds later. No cables, no “Connection Request” dialogs, no shared Apple ID — it works between a personal Mac and an MDM-managed work Mac.

~/Library/Logs/MagicTrackpadConnector.log

Mac A · personal · holds the trackpad

09:07:37.690 [Sys]    screen locked
09:07:37.696 [Policy] lock: handing devices to Mac B
09:07:37.742 [Flow]   push(lock): releasing
09:07:39.301 [BT]     unpair d0-c0-…-2d (link was up: true)
09:07:40.104 [BT]     release: unplug acknowledged
09:07:40.105 [State]  devices are not here
09:07:43.616 [Flow]   push(lock): done ["d0-c0-…-2d"]

Mac B · work (MDM) · receiver

09:07:37.731 [Net]    prepare from Mac A — watchdog armed
09:07:40.122 [Net]    receive ["d0-c0-…-2d"]
09:07:40.130 [BT]     pair d0-c0-…-2d …
09:07:43.190 [BT]     pair -> ok paired=true connected=true
09:07:43.594 [State]  devices are here
09:07:43.601 [Net]    → acquired ["d0-c0-…-2d"]
▍

Automatic policy

It follows you around.

The two apps watch lock, sleep, wake and idle time on each Mac and agree on who should hold the devices.

lock

Push to the other Mac if it’s unlocked.

sleep

Push before sleeping — sleep is held ≤ 25 s until done.

shutdown

Push immediately, skipping the disconnect wait.

wake / unlock

Take back from a holder idle ≥ 120 s.

launch

Take only if nobody holds it, or the holder is away.

⌃⌥⌘T

Manual toggle, also from the menu bar.

  • No cables. No dialogs.
  • Different Apple IDs are fine.
  • Trackpad, Keyboard and Mouse move independently.

Failover

If a Mac goes away, the trackpad doesn’t.

The other Mac is always listening. A clean shutdown hands the trackpad over before the power goes; a crash or power loss puts the survivor into recovery mode.

  • Handed over before power-off. Sleep is held up to 25 s and shutdown skips the disconnect wait, so the release lands while the Mac is still alive.
  • Receiver has a watchdog. If Mac A dies right after prepare, Mac B pairs anyway.
  • The trackpad stays bound to the dead Mac. Every other host gets 0x02 — that’s the hardware, not the app.
  • Mac B keeps paging for 10 minutes. It retries every ~3 s and shows a power-cycle hint in the menu.
  • Switch the trackpad off and on. It becomes pairable and Mac B takes it within seconds.

failover — clean shutdownfailover — crash / power loss

Mac Aholdingshutting downoff
Mac Breadyholding
A[Sys] power off / logout
A[Policy] shutdown: handing devices to Mac B
A[Flow] push(shutdown): releasing
B[BT] pair d0-c0-…-2d -> ok connected=true
B[State] devices are here ✓ ~3 s
Mac Aholdingno power
Mac Breadyretrying · 0x02holding
B[Net] peer lost
B[Policy] periodic: peer unreachable — claiming
B[BT] pair d0-c0-…-2d -> refused 0x02
B[Policy] bound to a Mac that is gone — waiting for a power cycle
⏻ you switch the trackpad off and on
B[BT] pair d0-c0-…-2d -> ok connected=true
B[Policy] recovered the stuck device
B[State] devices are here ✓

How it works

One unpair, one pair. About 3 seconds.

Magic devices remember exactly one host key. If the holder unpairs the device while it is connected, macOS sends the HID Virtual Cable Unplug: the device forgets its host and becomes pairable, and the receiver pairs at once with silent “Just Works” pairing.

  • Never unpair before HID is open. Unpairing 1–5 s after a fresh connect strands the device (0x02 for every host). settle() waits for HID + 1.5 s.
  • Never release without a live receiver. A released device stops answering within minutes, so with no reachable peer, sleep and shutdown keep it.
  • Recovers from a dead holder. On 0x02, retry every ~3 s for 10 min and show the power-cycle hint in the menu.
  • Watchdog on the receiver. After prepare, it pairs anyway if the sender vanishes mid-handoff.

handoff sequence

Mac A                  Trackpad                   Mac B
  │                        │                        │
  │── prepare ─────────────────────────────────────▶│
  │◀──────────────────────────────────────── ok ────│
  │ settle(): HID + 1.5 s  │                        │
  │── unpair ─────────────▶│                        │
  │   Virtual Cable Unplug │ forgets host           │
  │── receive ─────────────────────────────────────▶│
  │                        │◀──── pair + connect ───│
  │◀────────────────────────────────── acquired ────│
  │                        │          ≈ 3 s total   │

Under the hood

Small, native, paranoid.

IOBluetooth, in-process

One dedicated run-loop thread, serialized by a queue. Unpair uses the private remove selector. No blueutil — it can’t get Bluetooth permission under launchd/SSH.

Bonjour + TCP :7890

_mtconnector._tcp, JSON lines, IPv4-only (some MDM Macs advertise ::1), with a configurable fallback address.

# Signed messages

HMAC-SHA256 with key = HKDF-SHA256(pairing code, mtconnector-v1). Timestamps ±120 s, persisted nonces, reflection checks.

⌁ Hardened server

64 KB lines, 2 s reads, 4 connections per host / 16 total, network IPv6 refused. Unsigned requests never reach a handler.

zsh — magic-trackpad-connector

$git clone https://github.com/villegascmarco/magic-trackpad-connector.git
$cd magic-trackpad-connector
$python3 Tools/simulate_handoff.py
all scenarios pass
$Tools/release.sh
→ build/release/Magic-Trackpad-Connector-1.0.dmg
$Tools/ctl.sh '{"action":"status"}'
{"status":"ok","holds":true,"available":true,"role":"primary",…}
$▍

Open source

Build it yourself.

MIT-licensed Swift, Xcode 26+. The handoff recipes are mirrored in a Python simulator, and a two-Mac end-to-end suite covers toggle, lock, sleep, races and fallback.

  1. Read the measured Bluetooth facts in REQUIREMENTS.md
  2. Probe a running app over the loopback control port
  3. Ship your own signed build with Tools/release.sh

Install

Two Macs, five minutes.

01

Install on both

Drag the app from the .dmg to Applications. Not notarized: Privacy & Security → Open Anyway.

02

Allow access

Bluetooth and Local Network, once per Mac. On MDM Macs, clear the quarantine first:

xattr -dr com.apple.quarantine \
  /Applications/magic-trackpad-connector.app
03

Pair the apps

Enter the same pairing code on both Macs (Settings → Network → Generate).

04

Pick roles

One Mac is Main, the other Secondary. Check the devices to move. Done.

Limits: exactly two Macs on the same network. Not on the Mac App Store (private IOBluetooth API, runs outside the sandbox). Tested with a Magic Trackpad on macOS 27.2; Keyboard and Mouse share the code path but are untested on hardware. If a Mac dies holding a device, switch the device off and on.

Stop re-pairing your trackpad.

Free and open source. Install it on both Macs and lock your screen.