software-trackpoint input driver

Andrew Deason adeason+lists at dson.org
Wed Aug 21 21:38:38 PDT 2013


Hi,

I have a USB trackpoint device I would like to use with X on Linux (the
trackpoint is the nub mouse thing on some keyboards, usually known for
laptop keyboards). All current input drivers seem to interpret movement
data for it incorrectly, and I'd like to fix that. But I'm unfamiliar
with xorg development, so I'm not sure where such code "should" go.

So anyway, for reference, the device looks like this:

# evtest /dev/input/event17
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x6cb product 0x9 version 0x15
Input device name: "Synaptics Inc. Composite TouchPad / TrackPoint (Stick)"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 272 (BTN_LEFT)
    Event code 273 (BTN_RIGHT)
    Event code 274 (BTN_MIDDLE)
  Event type 2 (EV_REL)
    Event code 0 (REL_X)
    Event code 1 (REL_Y)
  Event type 3 (EV_ABS)
    Event code 24 (ABS_PRESSURE)
      Value      0
      Min        0
      Max      127

The information that Linux gives us about this device is something like
the pressure readings for the x (REL_X), y (REL_Y), and z (ABS_PRESSURE)
axes [1]. Most trackpoint devices I have encountered before internally
process these pressure readings and just give the OS relative pointer
movements, but this one seems to rely on an OS driver performing that
calculation [2]. Right now by default this gets handled by evdev, which
just interprets the x and y coordinates as relative mouse movements, and
ignores the pressure. I would like something to interpret that pressure,
as it results in a much more familiar and intuitive trackpoint feel (how
all other trackpoint devices feel).

As mentioned, I'm unfamiliar with xorg dev, so I'm not exactly sure
where support for this should go. There is an existing driver for
'synaptics', but from what I can tell it is focused on touchpads, not
trackpoints. There is also another driver for pointing sticks
specifically: <https://github.com/hiikezoe/xf86-input-pointing-stick>,
but currently it does not support devices like this.

Modifying evdev to interpret the ABS_PRESSURE axis seems easy enough
(that's what I'm doing right now, so I can use it), but I'm not sure if
it's frowned upon to put such device-specific stuff in evdev? I could
add support to xf86-input-pointing-stick, or even add an entirely new
driver just for this, but evdev has other features I want for this, like
emulated wheel scrolling; duplicating code for those features in other
driver seems not great.

So my intuition says to just add support for evdev. Or the Linux kernel
driver could do this kind of calculation itself, to make the device
appear more like other trackpoint devices, like the PS/2 ones; then the
evdev X driver would do the right thing. Am I on the right track, here?


[1] Actually, there are two modes of operation, via USB alternate
interfaces. One interface provides regular HID mouse relative
coordinates, and that works fine, but does not allow the user to change
the speed/sensitivity/etc that is used to generate the coordinates. The
other "advanced" interface provides the information described above, and
that is currently what the synaptics_usb driver in Linux always uses.

[2] Aside from the fact that we get a separate 'pressure' reading at
all, which suggests this, this has been confirmed by myself and others
by sniffing USB traffic on a Windows machine with the
IBM/Lenovo-provided driver. Changing sensitivity settings for the
trackpoint results in no USB traffic, so this clearly doesn't work like
e.g. PS/2 trackpoint devices.

-- 
Andrew Deason
adeason at dson.org



More information about the xorg-devel mailing list