1

I try to use an "old" Apple magic trackpad (AMT) as a drawing tablet on my Linux laptop:

  • Dell XPS
  • ArchLinux
  • Xorg
  • Xfce 4

I configured Xorg to use evdev driver for the AMT because synaptics does not provide absolute coordinates at all, and libinput does not seem to provide them for Xorg.

Up to now, the AMT is connected and I can click (with the hardware button) but the tap-to-click and the motion do not work...

Below is the output of some useful commands:

$ xinput list --long 12
Trackpad de Romain                          id=12   [slave  pointer  (2)]
    Reporting 7 classes:
        Class originated from: 12. Type: XIButtonClass
        Buttons supported: 5
        Button labels: "Button Left" "Button Unknown" "Button Unknown" "Button Wheel Up" "Button Wheel Down"
        Button state:
        Class originated from: 12. Type: XIValuatorClass
        Detail for Valuator 0:
          Label: Abs MT Position X
          Range: -2909.000000 - 3167.000000
          Resolution: 46000 units/m
          Mode: absolute
          Current value: -1556.000000
        Class originated from: 12. Type: XIValuatorClass
        Detail for Valuator 1:
          Label: Abs MT Position Y
          Range: -2456.000000 - 2565.000000
          Resolution: 45000 units/m
          Mode: absolute
          Current value: -1451.000000
        Class originated from: 12. Type: XIValuatorClass
        Detail for Valuator 2:
          Label: Abs MT Touch Major
          Range: 0.000000 - 1020.000000
          Resolution: 0 units/m
          Mode: absolute
          Current value: 0.000000
        Class originated from: 12. Type: XIValuatorClass
        Detail for Valuator 3:
          Label: Abs MT Touch Minor
          Range: 0.000000 - 1020.000000
          Resolution: 0 units/m
          Mode: absolute
          Current value: 0.000000
        Class originated from: 12. Type: XIValuatorClass
        Detail for Valuator 4:
          Label: Abs MT Orientation
          Range: -31.000000 - 32.000000
          Resolution: 0 units/m
          Mode: absolute
          Current value: -13.000000
        Class originated from: 12. Type: XITouchClass
        Touch mode: dependent
        Max number of touches: 16


$ xinput list-props 12
Device 'Trackpad de Romain':
    Device Enabled (162):   1
    Coordinate Transformation Matrix (164): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    Device Accel Profile (295): 0
    Device Accel Constant Deceleration (296):   1.000000
    Device Accel Adaptive Deceleration (297):   1.000000
    Device Accel Velocity Scaling (298):    10.000000
    Device Product ID (286):    1452, 782
    Device Node (285):  "/dev/input/event20"
    Evdev Axis Inversion (299): 0, 0
    Evdev Axis Calibration (300):   <no items>
    Evdev Axes Swap (301):  0
    Axis Labels (302):  "Abs MT Position X" (293), "Abs MT Position Y" (294), "Abs MT Touch Major" (290), "Abs MT Touch Minor" (291), "Abs MT Orientation" (292), "None" (0), "None" (0)
    Button Labels (303):    "Button Left" (165), "Button Unknown" (287), "Button Unknown" (287), "Button Wheel Up" (168), "Button Wheel Down" (169)
    Evdev Scrolling Distance (304): 0, 0, 0
    Evdev Middle Button Emulation (305):    0
    Evdev Middle Button Timeout (306):  50
    Evdev Middle Button Button (307):   2
    Evdev Third Button Emulation (308): 0
    Evdev Third Button Emulation Timeout (309): 1000
    Evdev Third Button Emulation Button (310):  3
    Evdev Third Button Emulation Threshold (311):   20
    Evdev Wheel Emulation (312):    0
    Evdev Wheel Emulation Axes (313):   0, 0, 4, 5
    Evdev Wheel Emulation Inertia (314):    10
    Evdev Wheel Emulation Timeout (315):    200
    Evdev Wheel Emulation Button (316): 4
    Evdev Drag Lock Buttons (317):  0

Running sudo libinput debug-gui, everything work (except that it seems to use relative coordinates instead of absolute).

Running sudo libinput debug-events actually displays lines like event20 POINTER_MOTION ... but the cursor does not move...

Finally running xinput --test-xi2:

  • When moving finger on the laptop's trackpad, I get some Motion events (EVENT type 6)
  • When moving finger on the AMT, I get some TouchUpdate events (EVENT type 19) with valuators values reflecting absolute position of the finger on the pad.

I also tried to use libinput changing the acceleration profile to use the flat profile. While the behavior would not be the same than absolute coordinates, it would be suitable to draw. However, acceleration profile is not available for trackpad... According to a libinput issue, but I can re-compile it to provide flat acceleration profiles, but I don't know if this will allow to select profile or only provide the flat profile, in which case I need both drivers, the vanilla one for common devices and the patched one for AMT.

How to make the AMT working, at least on Gimp.

1 Answer 1

0

As expected, recompiling libinput allows to use different acceleration profiles for touchpads (flat or adaptive scheme).

Then just creating an X.org configuration:

$ cat /etc/X11/xorg.conf.d/99-apple-magic-trackpad.conf

Section "InputClass"
    Identifier "Apple Magic Trackpad"
    MatchUSBID "05ac:030e"
    MatchIsTouchpad "on"
    Driver "libinput"
    Option "AccelProfile" "flat"
EndSection

You can even change the acceleration profile on runtime:

# Set flat acceleration scheme
xinput set-prop $deviceId 318 0, 1

# Set adaptive acceleration scheme
xinput set-prop $deviceId 318 1, 0

Last, for Arch users, I published a package on AUR to enable this.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .