Apple Magic Trackpad 2在Ubuntu 16.04下多指功能失效求助
I’ve dealt with this exact headache before—when the trackpad gets recognized as a generic input device instead of a proper touchpad, all the useful gestures like tap-to-click and two-finger scrolling stop working entirely. Let’s walk through the steps to get everything back on track:
1. Confirm How Your System Sees the Trackpad
First, let’s nail down the device’s identity:
- Run
lsusband look for the Apple Magic Trackpad 2 entry (it’ll show up as something likeApple, Inc. Magic Trackpad 2with a vendor ID of05ac). Jot down the 4-digit product ID (it’s the number after the colon, e.g.,0265). - Next, run
sudo evtest, select the event device linked to your trackpad, and test interactions. As you noticed, moving your finger will log events, but tapping or scrolling won’t—this confirms the device isn’t being treated as a touchpad.
2. Force Udev to Recognize It as a Touchpad
The core problem is udev isn’t tagging the device correctly. Let’s fix that with a custom rule:
- Create a new rule file:
sudo nano /etc/udev/rules.d/90-magictrackpad2.rules - Paste this line (replace
XXXXwith the product ID you noted earlier):SUBSYSTEM=="input", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="XXXX", ENV{ID_INPUT_TOUCHPAD}="1", ENV{ID_INPUT}="1" - Save and exit (Ctrl+O, Enter, Ctrl+X)
- Reload udev rules:
sudo udevadm control --reload-rules - Unplug/replug the trackpad (or restart Bluetooth if it’s paired wirelessly)
3. Fix the DKMS Driver Installation
Since you already installed the magictrackpad2-dkms package, let’s make sure it’s properly loaded:
- Check if the module is active:
dkms status—you should seemagictrackpad2listed with your current kernel version. - If it’s missing, load it manually:
sudo modprobe magictrackpad2 - If the module fails to load, rebuild it:
(Replacesudo dkms remove magictrackpad2/<version> --all sudo dkms install magictrackpad2/<version><version>with the version number shown indkms status)
4. Enable Gestures in libinput
Ubuntu 16.04 uses libinput for input handling, so let’s explicitly enable gestures for your trackpad:
- Open the libinput config file:
sudo nano /etc/X11/xorg.conf.d/40-libinput.conf - Add this section (replace
XXXXwith your product ID):Section "InputClass" Identifier "Apple Magic Trackpad 2" MatchIsTouchpad "on" MatchVendor "05ac" MatchProduct "XXXX" Driver "libinput" Option "Tapping" "on" Option "TappingButtonMap" "lrm" Option "NaturalScrolling" "on" Option "ScrollMethod" "twofinger" EndSection - Save the file, then log out and back in (or run
sudo systemctl restart lightdmif you use LightDM)
5. Test the Fixes
Run evtest again—you should now see events when tapping or scrolling. Try out tap-to-click and two-finger scrolling; they should work as expected.
If issues persist, double-check the product ID in your udev rule and libinput config, and ensure the DKMS module is built for your exact kernel version.
内容的提问来源于stack exchange,提问作者Aitch

