The Magic Mouse is a wireless mouse with a multi-touch surface that serves as mouse buttons and scroll wheel. It should work with Ubuntu 11.04 out of the box. To configure the mouse
- Open Bluetooth Preferences
- Switch on the Magic Mouse
- Click Set up new Device...
- The set up wizard will appear, click Forward
- Your computer will scan for new devices. Once your mouse is found select it and click Forward
- You will be asked for a pin to pair the mouse. Enter 0000 and then click OK.
- Click Finish
Ubuntu 10.04 and earlier
For Ubuntu 10.04 and 9.10 there is a driver for this device that is still under development, you can download it from the following address:
This code contains a Linux kernel driver for the magic mouse. Please see the INSTALL file for directions on how to use it with your kernel.
This code also contains three standalone programs:
hid-parse reads one or more input files (specified on the command line) that contain hexadecimal-formatted HID report descriptors, and prints out human-readable text forms of the descriptors. It should be considered fairly complete and stable.
mtalk talks to an Apple Magic Mouse (using L2CAP with the HID control and interrupt Protocol and Service Multiplexors [PSMs]) and prints human-readable forms of the messages that it receives. Typically the only command-line parameters you would pass are -r <BluetoothAddr>. It should be considered 85% complete.
usb-bt-dump reads a text dump in the format generated by Linux's usbmon (e.g. /sys/kernel/debug/usb/usbmon/0u) to parse Bluetooth messages at various layers (HCI, L2CAP, etc) and print annotations with the parsed form. It is woefully incomplete and buggy and will probably not be maintained.
I wrote usb-bt-dump first, followed by mtalk, followed by hid-parse. mtalk is the only one that I expect to modify going forward.
INSTALLING THE MAGICMOUSE DRIVER
The Magic Mouse driver for linux is a module named hid-magicmouse.
Older kernels do not have all the hooks that a driver needs to talk to the Magic Mouse. These are provided in this directory; you must apply them and rebuild the kernel before you can load hid-magicmouse. To apply the patch series, change to your linux-2.6 directory, and run either:
git apply *.patch
OR (in a Bourne shell, such as /bin/sh):
for PATCH in *.patch ; do patch -p1 < $PATCH ; done
This series were cherry-picked from the HID and Bluetooth trees onto v22.214.171.124. They should be filtering from the HID and Bluetooth trees into the mainstream kernel between v2.6.33 and v2.6.34. This directory's hid-magicmouse.c should match the final result of applying the patches in sequence.
You will obviously need to reboot into the new kernel before the module can be loaded, but at that point user-space should see it as a normal input device, including a(n emulated) scroll wheel and middle button.
A great howto can be found here: http://ubuntuforums.org/showpost.php?p=8777663&postcount=21