AppleMagicTrackpad

Apple Magic Trackpad - Wikimedia Commons

The Magic Trackpad is a multi-touch trackpad produced by Apple Inc.

It can be used as a single-touch device in Ubuntu by pairing it using the Bluetooth utilities in Ubuntu. The following setup instructions only need to be followed once, then Ubuntu will recognize the Magic Trackpad without further configuration.

Also note the nubs on the underside of the trackpad act as the mouse button - the two rubber pieces act as such when you press *on* the device itself.

Testing

You can confirm that gestures are recognized by following the directions here:

In order to use this device with other multi-touch software, you will need to know its input device name and number.

Here is example output for lsinput with a Magic Trackpad present (other irrelevant input device removed):

$ sudo lsinput

/dev/input/event7
   bustype : BUS_BLUETOOTH
   vendor  : 0x5ac
   product : 0x30e
   version : 352
   name    : "Apple Wireless Trackpad"
   phys    : "XX:XX:XX:XX:XX:XX"
   uniq    : "XX:XX:XX:XX:XX:XX"
   bits ev : EV_SYN EV_KEY EV_REL EV_MSC

In this case the input device would be /dev/input/event7. The input device number would be 7.

For more information on testing this device for multi-touch support, see Multitouch/Testing.

Once you've confirmed the above, you can try using PyMT.

Pairing the Magic Trackpad

Using graphical tools

Once you have inserted batteries in your Magic Trackpad, if your system is Bluetooth-capable and its radio is enabled, you will see a dialog box asking for a PIN to pair it:

Screenshot-Untitled Window.png

Such pairing can be forced by pressing and holding the button at the top-right side of the tablet.

You need to provide 0000 as the PIN code and press Enter to pair the trackpad. Once this has been done you need to permanently authorize this device to pair with your system. You can do so by going to the Bluetooth applet and choosing Apple Wireless Trackpad > Connect:

Screenshot.png

You will then be asked to confirm authorization to connect from this device. Make sure the "Always grant access" checkbox is ticked and click on Grant:

Screenshot-Untitled Window-1.png

Once these steps have been completed the trackpad will remain available in Ubuntu.

If the above instructions fail, see below for manual Bluetooth pairing instructions.

Problem: Pairing does not persist between reboots on Maverick (10.10)

If you find that you are not being prompted to "Always grant access" and that the device is not available after a reboot (i.e., you have to reconnect), try adding the pincode for the device (0000) to /var/lib/bluetooth/<physical_device_ID>/pincodes, like so:

In a terminal:

  1. Determine the physical (model-specific) and unique device IDs from the output of lsinput (from the "input-tools" package) as shown above.

  2. Create /lib/bluetooth/<physical_ID>/pincodes as the root user (or with sudo):

     # This folder *should* already exist, create it with 'sudo mkdir' if not.
     # You can use TAB to complete, if it's the only Bluetooth device on your system:
     cd /lib/bluetooth/<physical_ID>
    
     sudo gedit pincodes
    Add this line to the new file, save, and exit:
     <unique_ID> 0000

    where <physical_ID> is a backslash-escaped physical device ID, like D8\:30\:62\:38\:18\:02, and <unique_ID> is your device's unique ID, both from the output of lsinput.

See also: ubuntuforums.org's [HOWTO] Apple Magic Mouse on 10.10 Maverick Meerkat and bluez bug #61838.

Using the command line

First, verify that your Bluetooth radio is indeed on. Open a terminal window and issue the following command:

$ hcitool dev
Devices:
        hci0    XX:XX:XX:XX:XX:XX

The above example output shows what you would see if / when your Bluetooth radio is detected and enabled.

Next, let's scan for nearby Bluetooth devices. Note you must press the pairing/ON/OFF button for approximately 10 seconds on your Magic Trackpad for it to enter "pairing" mode. A small green light will start flashing.

$ hcitool scan
Scanning ...
        XX:XX:XX:XX:XX:XX       Apple Wireless Trackpad

The above output has important information. The bluez-compat package needs to be installed before requesting pairing:

$ sudo apt-get install bluez-compat

Then we can use the "XX..." string to request pairing of the trackpad:

$ sudo hidd --connect XX:XX:XX:XX:XX:XX

There should be no output after the above command, however your trackpad should now be recognized and act as a single-touch device.

Support on Ubuntu 10.04 (Lucid Lynx)

By default, it's possible to pair the Magic Trackpad and use basic mouse-like functionality with the regular left-click being available via the physical click only; tapping and scrolling will not work. As of September 8th, with the unsupported 2.6.35 (Maverick) kernel from the Ubuntu Kernel Team PPA, all expected basic functionality (two-finger scrolling, tap to click, right and middle click emulation through two and three finger taps respectively) works by using the "synaptics" X driver.

Support for Magic Trackpad on Ubuntu 12.04 LTS (Precise Pangolin) on iMac 27¨ (2013 revision)

The Long Term Stable version of Ubuntu supports the Apple wireless Keyboard and the wireless Trackpad. While automatic pairing of Ubuntu to the keyboard is as you might expect, pairing with the Trackpad is not quite so intuitive, until you realise what may be happening... With the wireless keyboard, the Ubuntu Bluetooth utility asks you to type a random six digit security code on the keyboard, to enable the pairing. This is not possible with the Trackpad! The Trackpad his an ínbuilt code of ´0000´.

Pairing the Bluetooth Trackpad to Ubuntu 12.04:- Within the Settings | Bluetooth utility, first press Add (+) and Continue | PIN Options | ´Fixed PIN 0000´ and then Close (start searching) BEFORE starting-up the Trackpad registration (pressing-in its power button for several seconds). You need to specify ´Fixed PIN 0000´ BEFORE the System Administrators Trackpad is found and added to the selection list by Ubuntu! It appears that the fixed PIN is behaving like a filter for any incoming Bluetooth pairing requests; that when Ubuntu knows this, it accepts the Trackpad (default of ´0000´) and pairing then completes automatically as you would expect. This pairing is persistent between system re-boots and powering off-on, though you might wish to have a spare USB keyboard and mouse available, just in case. On top line of the Ubuntu screen you should select the appropriate Macintosh keyboard for your locale, especially if wishing to access some of the more quirky keyboard characters during login (@ or # or currency symbols).

Having paired Ubuntu Bluetooth and the Magic Trackpad, you have a physical right and left click, normal scrolling with a single or double click, also two-finger scrolling going up and down an list, or sideways on a screen, or zoom-in or -out, also a three finger gesture to grab the current screen and relocate it on the desktop (nearly as flexible as the iMac´s OS X). Regrettably, when you switch between Linux Ubuntu and Apple OS X, you are obliged to re-pair the keyboard and trackpad afresh - a little niggle worth paying, if you prefer the greater contrast and larger characters of Ubuntu on the iMac 27¨ super high definition screen.

Known issues

Using Ginn for multi-touch gesture inputs

This method utlises Ginn to produce keyboard and mouse events based on multi-touch gesture events. This utilises the standard evdev driver and therfore the Synaptics style functionality method conflicts. The Ginn method will emulate the Synaptics style and provide additional functionality

1) Install Ginn

  sudo apt-get install ginn

2) Download the attached Ginn wishes file wishes.xml and save to your home folder. Replace /etc/ginn/wishes.xml with the downloaded version.

  sudo mv ~/wishes.xml /etc/ginn/wishes.xml

3) Execute: ginn

  ginn

As ginn is a little unstable at present, the ginn-wrapper script can be used to automatically restart ginn if it crashes.

Synaptics style functionality

In Ubuntu 10.10, some typical trackpad features are not available when using the default gesture support. These include two finger scrolling and two finger tap for right click. Ubuntu 11.04 and on allow for gestures and these trackpad features at the same time.

If you are running 10.10 and want to switch from gesture support to traditional trackpad support, add this section to /etc/X11/xorg.conf, creating the file if necessary:

Section "InputClass"
         Identifier "Magic Trackpad"
         MatchUSBID "05ac:030e"
         Driver "synaptics"
EndSection

Multitouch/AppleMagicTrackpad (last edited 2013-10-21 16:13:22 by host86-136-125-87)