

If you’ve ever installed Ubuntu or another Linux distro on your MacBook, MacBook Pro, or iMac, you’ve probably run into one persistent frustration: the Apple Magic Mouse and Trackpad just don’t behave like they do when running macOS, but normal ‘Windows” mice work fine.
After pairing via Bluetooth, you might notice that the right-click (secondary click) doesn’t work, the left-click only registers on the far edge, and scrolling or gestures are unreliable at best, if not have a complete mind of their own!
For devices that feel magical on macOS, they can seem downright clunky on Linux. But don’t worry there s a clean, open source solution that fixes everything, its called ‘Magic Mouse HID driver for Linux’ by Ricardo Rodrigues. This lightweight driver re-enables full Apple-style functionality for both the Magic Mouse and the Magic Trackpad under Ubuntu all in under ten minutes.
The Problem: Apple Magic Mouse on Ubuntu
When you connect your Magic Mouse or Trackpad to Ubuntu, it’s recognized as a generic HID (Human Interface Device). The Linux kernel includes a basic driver (hid_magicmouse), but it lacks the full Apple-specific support you’re used to, as you’ll know from using a Windows mouse with macOS there is something different about these magic mice and that’s why they don’t work like they should. It’s frustrating because the Magic Mouse hardware itself is excellent it just needs the right software layer.
Typical issues include:
-
Right-click not working (or only works occasionally)
-
Left-click zones inconsistent, requiring firm presses on the far left side
-
No smooth scrolling or gestures
-
Battery percentage not reported correctly
-
Overall lag or stutter when using Bluetooth
The Solution: magicmouse-hid Driver
That’s where the Linux-Magic-Trackpad-2-Driver project comes in. Developer Ricardo E. P. Rodrigues created a modern replacement for the kernel’s built-in driver. His project, hosted on GitHub as Linux-Magic-Trackpad-2-Driver, adds proper gesture handling, right-click recognition, and full multitouch support for:
The driver is distributed as a DKMS module (Dynamic Kernel Module Support), which means it automatically rebuilds itself whenever Ubuntu updates your kernel no need to reinstall it every time you upgrade.
How to Install the Magic Mouse / Trackpad Driver on Ubuntu
The process is simple and safe. It doesn’t modify your kernel permanently and can be uninstalled easily.
Step-by-Step Guide
Open your terminal and run the following commands one by one: