Contact Us

If you are interested in our services leave your contact details below and our sales representatives will contact you.

The organization which you represent
Email address we will use to contact you
Longer contact form…
 
  • About

    mFabrik Blog is about mobile and web software development, open source and Linux. We tell exciting tales where business, technology, web and mobile convergence.

    Creative Commons License
    This work is licensed under a Creative Commons Attribution 3.0 Unported License.

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

Posted on October 11, 2009  by Mikko Ohtamaa
Filed Under linux, technology, ubuntu

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.

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 :(

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.

Other resources

 

Other posts by Mikko Ohtamaa

 

Comments

31 Responses to “Setting up multi-touch scrolling for Ubuntu 9.10 Karmic Koala Linux on Asus Eee 1005HA netbook”

  1. pat on October 22nd, 2009 1:59 pm
    Gravatar

    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. Chris on October 24th, 2009 7:33 pm
    Gravatar

    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. Chris on October 24th, 2009 7:39 pm
    Gravatar

    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. Michael on November 4th, 2009 9:37 am
    Gravatar

    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. Mikko Ohtamaa on November 4th, 2009 1:58 pm
    Gravatar

    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. mxrgus on November 4th, 2009 10:29 pm
    Gravatar

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

     
  7. Mikko Ohtamaa on November 5th, 2009 11:34 am
    Gravatar

    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. Chao on November 6th, 2009 4:01 pm
    Gravatar

    Hi,your emulation approach is really helpful.I translate it into chinese.The following url is the translated article.http://www.imchao.net/linux/setting-up-multi-touch-scrolling-for-ubuntu-9-10-karmic-koala-linux-on-asus-eee-1005ha-netbook.html

    If you have any copyright problems,contact me.

     
  9. i’m Chao-吼吼在这 » Blog Archive » 在Eee PC 1005ha上为Ubuntu打开多点触控 on November 6th, 2009 4:03 pm
    Gravatar

    [...] 原文:Setting up multi-touch scrolling for Ubuntu 9.10 Karmic Koala Linux on Asus Eee 1005HA netbook [...]

     
  10. Liberty on November 14th, 2009 9:11 pm
    Gravatar

    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

     
  11. Thirsty on November 18th, 2009 10:02 am
    Gravatar

    If it’s 1005HA then it’s a multi-touch mouse pad.

     
  12. Mikko Ohtamaa on November 19th, 2009 11:42 pm
    Gravatar

    Chao: all blog content is under CC-BY 2.0 license:
    http://creativecommons.org/licenses/by/2.0/

    I’ll add remark about this to blog.

     
  13. Reflections About my Thoughts » Blog Archive » Scroll 2 dita per Linux su eeepc 1005HA e simili! on November 28th, 2009 11:33 pm
    Gravatar

    [...] notizia la cercavo ancora prima di comprare il mio nuovo eeepc, e finalmente qualcuno (in questo momento lo sto proprio amando) ci è [...]

     
  14. Alex on November 29th, 2009 9:55 pm
    Gravatar

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

     
  15. Igor on December 2nd, 2009 2:09 am
    Gravatar

    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.

     
  16. Gonzalo Fernandez on December 2nd, 2009 3:34 am
    Gravatar

    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.”

     
  17. Mikko Ohtamaa on December 7th, 2009 4:18 pm
    Gravatar

    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

     
  18. Multi Touch (Touchpad) in Ubuntu 9.10, Synaptic | BrettShaffer.com on December 9th, 2009 7:02 pm
    Gravatar

    [...] (above directions credit blog.twinapex.fi) [...]

     
  19. davide on December 17th, 2009 6:23 pm
    Gravatar

    great thanks!
    d

     
  20. Alex on December 29th, 2009 4:44 pm
    Gravatar

    Hi
    I’m on a Arch and your script works like a charm too… :D

    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..!

     
  21. Mikko Ohtamaa on December 29th, 2009 9:00 pm
    Gravatar

    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?

     
  22. chris on January 23rd, 2010 10:23 pm
    Gravatar

    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

     
  23. andy on January 24th, 2010 12:12 am
    Gravatar

    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.

     
  24. chris on January 24th, 2010 4:35 pm
    Gravatar

    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?

     
  25. “Two Finger Scrolling” for Ubuntu 9.10 on Dell Latitude E6400 « Soma's Blog on February 15th, 2010 12:31 am
    Gravatar

    [...] 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. [...]

     
  26. igor-ipod on May 23rd, 2010 9:12 pm
    Gravatar

    Yeah! It works with asus eee pc 1201n (ubuntu 10.04)

     
  27. asus eeepc 1005PE - openSUSE Forums on June 11th, 2010 4:23 pm
    Gravatar

    [...] asus eeepc 1005PE Setting up multi-touch scrolling for Ubuntu 9.10 Karmic Koala Linux on Asus Eee 1005HA netbook | mFa… может [...]

     
  28. tzepu on June 11th, 2010 5:03 pm
    Gravatar

    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?

     
  29. Leo on July 20th, 2010 5:04 pm
    Gravatar

    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 !!!

     
  30. Leo on July 22nd, 2010 12:53 pm
  31. Leo on July 25th, 2010 8:42 pm
    Gravatar

    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)

     

Leave a Reply