Was bored today, lying on the couch with my notebook and wondering why Apple users get neat features like two finger scrolling and the linux crowd does not.
Well a few minutes of googling later I had learned that this is indeed supported by Linux but not enabled by default in Ubuntu. I had also found some very helpful sites that explain how to set it up for Ubuntu Karmic.
This blogpost talks about setting up multi-touch scrolling for the Asus Eee 1005HA netbook and the process in general. And this forum thread talks specifically about the ALPS touchpad which is built into my Dell Latitude E6400.
The main problem here appears to be that the ALPS touchpad does not support two finger recognition. However it is somehow “pressure sensitive”. Using the pressure value you can have the driver guess how many fingers you are probably using at the moment. The values output by the touchpad may vary between models, so it is best to start by debugging the touchpad output with synclient:
Reading out the touchpad values
Option "SHMConfig" "true" must be set in the xorg.conf .. but my xorg.conf does no longer contain a device section for the touchpad as most of the hardware is handled by HAL now. So I ended up creating a policy .fdi file for HAL which looks like this:
<?xml version="1.0" encoding="UTF-8"?> <deviceinfo version="0.2"> <device> <match key="info.product" string="AlpsPS/2 ALPS DualPoint TouchPad"> <merge key="input.x11_options.VertTwoFingerScroll" type="string">1</merge> <merge key="input.x11_options.HorizTwoFingerScroll" type="string">1</merge> <merge key="input.x11_options.EmulateTwoFingerMinZ" type="string">70</merge> </match> <match key="input.x11_driver" string="synaptics"> <merge key="input.x11_options.SHMConfig" type="string">True</merge> </match> </device> </deviceinfo>
After restarting HAL and the xserver (or rebooting) one can start synclient with
synclient -m 10 output
Synclient will give you a lot of information about your touchpad.. Take a close look at the “f” and “z” columns. The “f” column should report the number of fingers used on the touchpad, but unforatunately it always outputs “1″ on my computer. The “z” column represents the pressure value. Try operating the touchpad with one or two fingers and see how the value changes. You want to find a threshold that cleanly seperates operating with one finger from operating with two fingers. For me this threshold was about 70.
Enable 2 Finger Scrolling
Now all we have to do, is tell the driver to emulate “two finger mode” if the pressure value is over 70. This should be easy right? In a perfect world it would be. If you look closely at the above xml again, you will see that I put the corresponding lines right at the beginning of the file (and also the lines to enable two finger scrolling). My xorg.log shows that the statements are parsed correctly when the xserver starts, but for some reason they didnt have any effect in Ubuntu 9.10.
Fortunately the blogpost i mentioned before also shows a bash script to work around this problem. I had to modify some of the values in the original script. In particular the statments in the script tell the driver to emulate two finger operation when finger-pressure AND the finger-width (“w” column in the synclient output) exceed thresholds. Unfortunately my touchpad always reports a finger-width of 0, so I had to slightly adapt the script:
#!/bin/sh # # Use xinput --list-props "SynPS/2 Synaptics TouchPad" to extract data # # Set multi-touch emulation parameters xinput set-int-prop "AlpsPS/2 ALPS DualPoint TouchPad" "Synaptics Two-Finger Pressure" 32 70 xinput set-int-prop "AlpsPS/2 ALPS DualPoint TouchPad" "Synaptics Two-Finger Width" 32 0 xinput set-int-prop "AlpsPS/2 ALPS DualPoint TouchPad" "Two-Finger Scrolling" 8 1 xinput set-int-prop "AlpsPS/2 ALPS DualPoint TouchPad" "Synaptics Two-Finger Scrolling" 8 1 1 # Disable edge scrolling xinput set-int-prop "AlpsPS/2 ALPS DualPoint TouchPad" "Synaptics Edge Scrolling" 8 0 0 0 # This will make cursor not to jump if you have two fingers on the touchpad and you list one # (which you usually do after two-finger scrolling) xinput set-int-prop "AlpsPS/2 ALPS DualPoint TouchPad" "Synaptics Jumpy Cursor Threshold" 32 110
Note that this script only works if the SHMConfig option I mentioned above is active. The script also disables the “edge scrolling” on the touchpad to give you a little more space.
The end result
It works, but it does not work well. I played around with various threshold values for a bit, but I could not find a combination which gave me a responsive and consistent feeling. Finally I ended up disabling the feature again. I think the main culprit here is my touchpad, which does not report enough data to distinguish one-finger from two-finger operation with the required consistency. The feature is there though, and for other touchpads it might work quite well. It may not be perfect on my notebook but nevertheless it would be nice to see this in one of the upcoming Ubuntu versions.