Tuesday, April 26, 2011

Newer xorg, missing mouse features and xinput

Recent versions of xorg have seen changes in defaults for the behaviour of mice/touchpads, such as third button emulation or edge scrolling suddenly not working anymore. What is worse now is that the corresponding entries in the xorg.conf are now ignored... Wait, wait, don't go flaming the Xorg maintainers, but keep on looking rather. This is where I found out about xinput, the new way to customize/parametrize input devices for the X server. And, lets face it, it beats any customization that could have been done in xorg.conf ! Here's how to use it.

First, you'll have to install it from its own package (xinput), as it doesn't come bundled with standard X clients. Second, you can find out about the devices connected to your X server using:

~ xinput --list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=12   [slave  pointer  (2)]

It is easy to find the device you're interested in (here, say the touchpad entry). Then, you list the properties you can set/get using:

~ xinput --list-props "SynPS/2 Synaptics TouchPad"
        Synaptics Edge Scrolling (269): 0, 0, 0

The list is quite impressive, so I have only shown the one I'm interested in. You see here everything is 0, which probably explains why edge scrolling is disable (I don't have a clue what the actual numbers mean). You can finally change the properties this way:

xinput --set-prop "SynPS/2 Synaptics TouchPad" "Synaptics Edge Scrolling"  6 6 6

This gave me back edge scrolling. I used a similar approach to enable again the third button emulation... What is neat here is that the property names are readable enough, and there's a lot of them to play with. Great !


kapil said...

You can see what the properties mean by looking at "man synaptics" under "Device Properties". For example:

Synaptics Edge Scrolling
8 bit (BOOL), 3 values, vertical, horizontal, corner.

shi said...

Very useful information for a YANUB.

Emmanuel Lesouef said...

What sounds strange to me is that xorg doesn't auto-detect my synaptics touchpad...

But thanks for this tip.

Jon Dowland said...

yay for random numbers without context or explanation! Long let they permeate our systems.

Chris said...

Have you figured out how to perform the equivalent of xorg.conf.d snippits that match on certain rules (maybe I should be barking up udev's tree?).

I have a trackball that I configure sensitivity with xinput, but I need to run that command every time I plug it in.