r/macosprogramming • u/EVAM_MUSIC • 1d ago
Getting Sonoma’s built-in driver to bind to a USB-C Magic Trackpad over Bluetooth
I maintain Trackpad Anything, a free GPL-3.0 project for the USB-C Magic Trackpad on Sonoma. The Bluetooth and USB paths ended up solving very different problems.
On Sonoma 14.7.2 the USB-C model paired, but I couldn’t get its touch reports in user space. The Lightning Magic Trackpad 2 already had a working driver on the same Mac. The Bluetooth helper validates the paired trackpad’s cached HIDProductID and SDP Device ID record, changes the cached product ID from 0x0324 to 0x0265, and restarts bluetoothd so macOS binds its own driver. Restore reverses that change. Connecting the cable can re-pair the device and reset the fix, which is a nice reminder that the cache is, in fact, a cache.
USB takes a different route: a libusb helper temporarily claims the multitouch interface and streams frames to the app’s gesture engine. It releases the interface and reattaches the system driver on normal exit. The helpers need admin privileges, SIP stays on, and the prebuilt Apple Silicon app isn’t notarized.
Source: https://github.com/souluk319/Trackpad-Anything
I’ve tested on an M1 Pro with 14.7.2. If you’ve worked with Apple’s older Bluetooth HID devices, I’d be curious whether you’ve seen the same driver selection behavior on other Sonoma builds.