Setting up multi-touch scrolling for Ubuntu 9.10 Karmic Koala Linux on Asus Eee 1005HA netbook

This post is specific to Asus Eee 1005HA netbook, but the technique explained here can be used on any computer having Synaptics touchpad.

Multi-touch gestures allow you to perform user interface actions by doing two finger gestures on touchpad. Apple introduced this feature on Macbooks and after you get used to it, it greatly enhances your web browsing on mouseless netbook. The most important gesture is scroll text by swiping the touchpad with two fingers.

Apple has also many patents related to the gestures so they are not enabled by default.

The real multi-finger touch support needs multi-finger aware (capacitive) touchpad. Most PC laptops are not equipped with one. Luckily some of the simple gestures, like two finger scrolling, can be emulated on normal pressure point sensitive touchpad via clever calculations and other tricks.

Note: Ubuntu HAL support for Synaptics seem to be broken. Only shell script at the end of the post will work. HAL options in FDI file are being ignored.

1. Setting up Synaptics driver

Type in terminal

gksudo gedit /etc/hal/fdi/policy/11-x11-synaptics.fdi

Create and save file with this content:

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
 <device>
   <match key="info.capabilities" contains="input.touchpad">
       <merge key="input.x11_driver" type="string">synaptics</merge>
       <merge key="input.x11_options.SHMConfig" type="string">On</merge>

       <merge key="input.x11_options.EmulateTwoFingerMinZ" type="string">40</merge>
       <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.TapButton1" type="string">1</merge>
       <merge key="input.x11_options.TapButton2" type="string">3</merge>  <!--two finger tap -> middle clieck(3) -->
       <merge key="input.x11_options.TapButton3" type="string">2</merge>  <!--three finger tap -> right click(2). almost impossible to click -->
   </match>
 </device>
</deviceinfo>

This allows us to use synclient utility to watch touchpad real-time data in console window.

Now restart X

sudo /etc/init.d/gdm restart

And open terminal again.

Type in command

synclient -m 100

And you should see data like this scrolling in the terminal:

129.355  2912 3469  59 1  4  0 0 0 0 0  00000000   0  0  0   0   0
 129.455  2952 3529  59 1  4  1 0 0 0 0  00000000   0  0  0   0   0
 time     x    y   z f  w  l r u d m     multi  gl gm gr gdx gdy
 129.555  3283 3516  60 1  4  1 0 0 0 0  00000000   0  0  0   0   0
 129.656  3928 3517  60 1  4  1 0 0 0 0  00000000   0  0  0   0   0
 129.756  4364 3637  60 1  4  1 0 0 0 0  00000000   0  0  0   0   0
 129.856  4020 3329  49 1  4  0 0 0 0 0  00000000   0  0  0   0   0
 129.956  3634 3122  58 1  4  0 0 0 0 0  00000000   0  0  0   0   0
 130.057  3320 2957  60 1  4  0 0 0 0 0  00000000   0  0  0   0   0
 130.157  2779 3312  61 1  4  0 0 0 0 0  00000000   0  0  0   0   0
 130.257  2557 3739  61 1  4  0 0 0 0 0  00000000   0  0  0   0   0
 130.358  2636 3485  39 1  4  0 0 0 0 0  00000000   0  0  0   0   0
 130.458  2659 3104  60 1  4  0 0 0 0 0  00000000   0  0  0   0   0
 130.558  2671 2988  60 1  4  0 0 0 0 0  00000000   0  0  0   0   0

f column tells the number of fingers. w is the touched area width. z is the pressure.

If you put two fingers on touchpad and you see value f=2 then your hardware has multi-touch aware touchpad. Unfortunately Asus Eee 1005HA doesn’t seem to have one 🙁

2. Emulation approach

Synaptics driver can emulate two-finger touch with the following conditions

  • Touched area width exceeds certain threshold (min width)
  • Touch pressure exceeds certain thresholds

When the conditions are met the driver thinks “Wow looks this guy is pressing us really hard. maybe he is using two fingers?” Note that touchpad values are touchpad specific and values applying for one model don’t work on another computer.

Synaptics driver settings are described here. Synaptic driver settings can be modified run-time using xinput command. Run synclient -m 100 in one terminal window and change threshold values in other until you find correct emulation parameters for your laptop. Below is my xinput tests. Test scrolling on Firefox and any long web page.

moo@huiskuttaja:~$ xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Width" 32 7
moo@huiskuttaja:~$ xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Pressure" 32 280
moo@huiskuttaja:~$ xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Width" 32 11
moo@huiskuttaja:~$ xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Pressure" 32 50
moo@huiskuttaja:~$

Looks like the following parameters are good for two finger emulation for Asus Eee 1005HA:

  • Width: 8
  • Pressure (Z): 10

You can also use command synclient -l to dump the current settings.

Below is the final script you need to run during log-in (see note about broken HAL at the beginning of the post):

#!/bin/sh
#!/bin/sh # # Use xinput --list-props "SynPS/2 Synaptics TouchPad" to extract data # # Set multi-touch emulation parameters xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Pressure" 32 10 xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Width" 32 8 xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Two-Finger Scrolling" 8 1 xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Scrolling" 8 1 1 # Disable edge scrolling xinput set-int-prop "SynPS/2 Synaptics 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 "SynPS/2 Synaptics TouchPad" "Synaptics Jumpy Cursor Threshold" 32 110
Jumpy cursor after two finger scroll

When you do a two-finger scroll and lift your one finger before the other the mouse cursor/scrolling may jump. Synaptics driver does not seem to have an option to filter out this bad event. If anyone knows solution for this please comment.

3. Other resources

32 thoughts on “Setting up multi-touch scrolling for Ubuntu 9.10 Karmic Koala Linux on Asus Eee 1005HA netbook

  1. your script is great. The 1005HA touchpad was really annoying me. I would have liked to see full hardware support but this emulation script definitely gets the job done.

  2. Is there an easy way to undo the script? I don’t know why, but the script made it so any motion on the trackpad is interpreted as a scroll

  3. Oops nevermind! I just changed set-int-prop to delete-prop on them and my trackpad works now. Not sure why I was having that problem in the first place, though

  4. I think that the asus 1005ha does have multi touch capabilities. I have a dual boot machine and in windows you can spread and pinch with two fingers. Could this just be a clever tracking of the width parameter?

  5. Though Asus Eee PC screen saver claims multitouch support it is marked with asterisk (*) saying that only available on some models.

    I suspect 1005HA is the cheapest hardware available thus leaving out multitouch.

    Also Windows Synaptics or Linux Synaptics driver does not show that multitouch would be available.

  6. just choose preferences -> mouse -> touchpad under multitouch section select two-finger scrolling.

  7. Hi mxrgus,

    I am not sure whether to option works on touchpad which does not multitouch natively. You still need to go through to manual work to enable emulation.

  8. Pingback: i’m Chao-吼吼在这 » Blog Archive » 在Eee PC 1005ha上为Ubuntu打开多点触控

  9. I am pretty sure mxrgus is right. At the very least you can enable multi-touch scrolling in the 9.10 NBR version on my Asus 900ha

  10. Pingback: Reflections About my Thoughts » Blog Archive » Scroll 2 dita per Linux su eeepc 1005HA e simili!

  11. I tried it on Debian Squeeze/testing but, obviously it won’t work..
    Why ?
    I don’t know…
    Any help maybe ??
    Thanks!

  12. Hi,

    Just wanted send an update for Asus Eee PC 1008HA running Ubuntu 9.10, kernel 2.6.31-15-generic. I added the fdi as above and it didn’t work as you mentioned.

    On this particular model 1008HA middle button is button 2 and not 3 as set above. So, setting synclient to these values works great:
    TapButton1=1
    TapButton2=2

    Values can be changed and tested by using synclient instead of xinput as xinput won’t work. Type this in the term:
    synclient TapButton2=2
    To change the value or synclient -h for more help.

    I added these lines to a script which is set to run during log in:

    #!/bin/sh -e
    # This script sets the touchpad buttons to two and three finger tap.
    synclient TapButton2=2
    synclient TapButton3=0
    exit 0

    Last line disables tap with three fingers as it’s very difficult to tap touchpad this way.

    Hope it helps.

  13. Using Karmic in an Acer Aspire D250, this works perfectly, I only need to follow you instructions up to:

    sudo /etc/init.d/gdm restart

    And that’s it, no emulation, nothing more.

    Maybe you should remove your note:

    “Ubuntu HAL support for Synaptics seem to be broken. Only shell script at the end of the post will work. HAL options in FDI file are being ignored.”

  14. Hi Gonzalo,

    I think the HAL bit concerns only Eee, not Aspire, then. Hmm… maybe I should test it with all updates now when final release of Karmic is out

  15. Pingback: Multi Touch (Touchpad) in Ubuntu 9.10, Synaptic | BrettShaffer.com

  16. Hi
    I’m on a Arch and your script works like a charm too… 😀

    And I was wondering if you have any idea two “emulate” the two fingers zoom, which is the last thing that don’t work in my 1005ha….

    Thank you for all your good stuff..!

  17. Synaptic driver reports “width” of the pressure (I don’t know how it is calculated) so this could be used for two finger zooming. How to do it is another trick… some custom Firefox plug-in maybe?

  18. hi there, have tried running this script and tweaking the values but whatever i do the two finger scroll doesnt work in firefox, all it does is sometimes select the text in the direction im scrolling. ive tried lots of different width/pressure values to no avail. any ideas why it would be selecting text and not scrolling, ive also tried enabling two finger scroll in the mouse options panel but that made no difference.

    your script definitely made an improvement because before the mouse would go crazy if you pressed with two fingers, so it would be great if i could also get it to scroll as this worked fine in windows (before i install ubuntu 9.10 netbook remix)

    thanks

  19. Hey- using a EEE 1201N which claims to have multitouch, but the driver is not supporting it.

    I’m using Ubuntu 9.10 and your script works great! Thanks, I can now finally use 2 finger scrolling.

  20. it doesnt seem to work for me in ubuntu 9.10 nbr on asus 1005ha, i have tried lots of different values but two finger scrolling just selects the text in both firefox and chrome so i have no idea whats going on, any ideas?

  21. Pingback: “Two Finger Scrolling” for Ubuntu 9.10 on Dell Latitude E6400 « Soma's Blog

  22. Pingback: asus eeepc 1005PE - openSUSE Forums

  23. I tried to do so in lucid on an 1005 pe machine.
    I am stuck at saving the file. It tells me that there is no file.
    Should I create the directories for it?

  24. The script doesn’t work anymore on my asus 1201n after my latest update with Ubuntu 10.04, it worked great before this update 🙁

    Don’t know what went wrong and why I don’t have the multitouch anymore…

    Heeeelp !!!

  25. ubuntu freshly updated… NOT WORKING AGAIN, this time, it’s cyclic, the scrolling never stop to up and down -_- (new method, ancient method still doesn’t work)

  26. AFAIK the fact that the old method does not work any more is not a bug, but actually a feature that makes system architecture much easier and that drastically reduces boot time:

    In earlier days auto-detection of hardware was split between two programs: HAL (the program that used the .fd files) and UDEV. Both had more or less the same task – and it was never easy for a programmer to determine which of them to use for which task.

    Newer Ubuntu versions have moved all hardware support to UDEV and where therefore able to completely drop HAL.

Leave a Reply

Your email address will not be published. Required fields are marked *