Sunday, April 28, 2013

5.2 amd64 X200: xorg.conf to get Trackpoint to behave properly.

Heyya. One of the thing that I like about X200, is the lack of touchpad. I don't quite like touchpads. It's a nuisance at best. Surely some OS can disable the touchpad when external mouse is connected but then, what's the point? Most of the time I'll be ignoring the touchpad.

For X200, it only comes with Trackpoint with 3 buttons. The left and right buttons are the standard left-right click, and the middle button is for scrolling. In Windows, pressing the middle-button then using the Trackpoint will scroll to the desired point (Right, left, up, down). But that's for Windows, I want it for my 5.2.

Surely, what's the point of having the best documentations if I didn't use it, right? So, man xorg.conf. Then I notice something. In the INPUTDEVICE SECTION, it's stated that:

"It is usually not necessary to provide InputDevice sections in the xorg.conf if hotplugging is in use (i.e. AutoAddDevices is enabled). If hotplugging is enabled, InputDevice sections using the mouse, kbd and vmmouse driver will be ignored."

Now that's different from what I used to remember. Previously I just alter my /etc/X11/xorg.conf like this:

Section "InputDevice"
    Identifier    "Trackpoint"
    Driver        "mouse"
    Option        "Protocol"    "Auto"
    Option        "Device"    "/dev/wsmouse"
    Option        "Emulate3Buttons"    "False"
    Option        "EmulateWheel"    "True"
    Option        "EmulateWheenButton"    "2"
    Option        "XAxisMapping"    "6 7"
    Option        "YAxisMapping"    "4 5"
EndSection


But now that won't work. It doesn't do anything. My USB Mouse's wheel is working fine, but Trackpoint does nothing as I wanted. So I alter the SERVERLAYOUT section:

Section "ServerLayout"
    ...snip...
    Option        "AutoAddDevices"    "False"
EndSection


But then both the Trackpoint and USB Mouse is not working. At all. This is not good. After re-reading the relevant xorg.conf manual, I found the answer. It lies in the INPUTCLASS SECTION. This is the working snippet of my /etc/X11/xorg.conf files.

Section "InputDevice"
    Identifier    "Trackpoint"
    Driver        "mouse"
    Option        "Protocol"    "Auto"
    Option        "Device"    "/dev/wsmouse"
EndSection


Section "InputClass"
    Identifier    "Trackpoint"
    MatchIsPointer    "True"
    Option        "Emulate3Buttons"    "False"
    Option        "EmulateWheel"        "True"
    Option        "EmulateWheelButton"    "2"
    Option        "XAxisMapping"        "6 7"
    Option        "YAxisMapping"        "4 5"
EndSection


Basically the INPUTCLASS can be used to add different function to different input devices (eg: Trackpoint, USB Mouse with Scroller etc) if configured correctly. In my case, I managed to get the Trackpoint's scrolling function using the middle button and the paste buffer function is also working as needed. But then my USB Mouse is also inheriting the same function. Ah well I will try to alter the INPUTCLASS SECTION so that the Trackpoint and USB Mouse have distint function.

So in the end, I got my Trackpoint working as I wanted. Take note that I'm using cwm and scrolling is tested and working in vim, Firefox and other programs. Great.

Oh, before I forget. I had problem generating my xorg.conf as there's error when I use X -configure. X -configure exited with error. But in the end the xorg.conf file did got generated. Current status is:

- Trackpoint scrolling function now working.
- intel (4) is working fine.
- Video display is 1280x800.
- VGA Out is not tested yet.
- Ultrabase's DisplayPort & VGA Out is not yet tested.

Here's my current /etc/X11/xorg.conf.


No comments: