Two- and three-finger tapping on the AA1's touchpad

Discussion in 'Linux' started by Dolph, Sep 5, 2008.

  1. Dolph

    Dolph

    Joined:
    Sep 5, 2008
    Messages:
    3
    Likes Received:
    0
    Location:
    London, UK
    While I was examining the output from synclient (for the synaptics touchpad) I noticed that the touchpad doesn't register more than one finger (which I believe is common knowledge with the AA1 touchpad) but the "finger width" value increases accordingly. This gave me the idea that it might be possible to detect two- or three-finger taps on the touchpad by examining the finger width sent by the hardware.

    I've applied a patch to the synaptics RPM from Feodra 9 to try and add support for two- and three-finger tapping as described above, and with reasonable success. I can now tap with two fingers for a right-click or with three fingers for a middle-click.

    The premise of the modification is as follows. When the synaptics software detects a tap it examines the finger width sent by the hardware, and compares that to the value that it expects for a single-finger tap. If the value is three or more times this then it fakes a three-finger tap. If the value is twice the expected value (or more) but less than three times then it fakes a two-finger tap. Otherwise the behaviour of the tap is unchanged from the unmodified driver. My experiments with synclient (and subsequent tests with the modified driver) indicate that this is a relatively accurate way to detect the number of fingers used.

    Links to the patch and the modified RPM are provided below. However, there are some caveats to using this method:

    * My modification is unlikely to play nicely with the synaptics driver feature which allows for the automatic detection of palm taps, e.g. when pressed accidentally when typing. This is because both are designed to detect a large finger tap width. It may be necessary to disable the palm tap detection feature if you have problems. That said, I've not examined my system to see if palm tap detection is enabled or tried adjusting my palm-tap settings.
    * Because the hardware inherently can only detect one finger at a time, tapping with more than one finger can cause the software to think that one finger was moved rapidly (i.e. from the position of the first finger to the position of the second finger). This is interpreted as sliding, and the cursor will move accordingly. My tests indicate that the likelihood of this is related to the accuracy of the tap with two (or more) fingers. If the user can tap simultaneously with both fingers then the tap is correctly detected. Tapping with one finger slightly before the other increases the chance of the cursor moving.
    * The modification depends on an accurate value for the finger width with a normal, one-finger tap. This value is displayed by the output of "synclient -m 100", in the "w" column. The modified driver defaults to a value of 4, which is the value I saw when testing with synclient on my AA1 (and with my fingers!). I would expect this to work for most people, and the value can be changed in your xorg.conf file (see below) but remember that differently-sized fingers (i.e. from person to person) may require different settings.
    * The change that I've made is a minor one in terms of coding, but so far it's only been tested by me. Extra testing and feedback would be greatly appreciated.
    * I have a stock version of Fedora 9 on my AA1, and as a result I've not able to test the Fedora 8 package. However, I've applied the patch to the Fedora 8 synaptics package without error.

    For anyone who wants to test the patched driver, you should do the following:

    * Install / upgrade your synaptics package to http://dev.dairylogic.com/synaptics/synaptics-0.14.6-2.ff2.fc8.i386.rpm (for Fedora 8, including the default AA1 installation) or http://dev.dairylogic.com/synaptics/synaptics-0.14.6-7.ff1.fc9.i386.rpm (for Fedora 9).
    * Edit your xorg.conf file, and add the following options to your InputDevice section for the Synaptics touchpad (yes, I know it's a stupid name for the Xorg option, but I couldn't think of a better one!):

    Code:
            Option     "FingerFake"
    * Restart your X server.

    If the above doesn't work for you then there are a few things you can try - remember to restart your X server each time that you make changes to the xorg.conf file.

    First, make sure that single-finger tapping works. If you can't tap the touchpad to produce a left-click then the two- and three-finger taps won't work either. As I'm running Fedora 9, I had to explicitly set my button mappings in my xorg.conf file before any tap-clicking would work. If you can't produce a standard click then you can try adding this as well:

    Code:
            Option     "TapButton1" "1"
            Option     "TapButton2" "3"
            Option     "TapButton3" "2"
    Note that I've reversed my settings for buttons 2 and 3. The default is for a two-finger tap to produce a middle-click and a three-finger tap to produce a right-click. I prefer the other way around, but you can pick whatever order you like.

    Also, note that there are other options that will affect the behaviour of a one-finger tap. You may want to check the synaptics man page for further details.

    If a one-finger tap is working for you but two- and three-finger taps are failing then you should run "synclient -m 100" (feel free to change the value to something other than 100 - it indicates the polling frequency in ms). Examine the "w" column to see what finger width values you get when tapping with one, two or three fingers. They should be approximately proportional. My tests produced 4-5 with one finger, 7-8 with two and around 14 with three. The patched driver allows you to specify your expected value for one finger, and will then double and triple this to identify two or three fingers. The expected value for one finger, by default, is 4. If you want to override this then add the following entry to your xorg.conf file:

    Code:
            Option     "FingerWidth" "<value>"
    You should of course replace <value> with your preferred value.

    That's about it. I've not had enough time myself to decide if the changes make for a usable interface, but I'd be grateful for any feedback from other testers. Below are all of the files relating to the patched driver.

    * http://dev.dairylogic.com/synaptics/synaptics-0.14.6-fingerfake.patch

    * http://dev.dairylogic.com/synaptics/synaptics-0.14.6-2.ff2.fc8.i386.rpm
    * http://dev.dairylogic.com/synaptics/synaptics-debuginfo-0.14.6-2.ff2.fc8.i386.rpm
    * http://dev.dairylogic.com/synaptics/synaptics-0.14.6-2.ff2.fc8.src.rpm

    * http://dev.dairylogic.com/synaptics/synaptics-0.14.6-7.ff1.fc9.i386.rpm
    * http://dev.dairylogic.com/synaptics/synaptics-debuginfo-0.14.6-7.ff1.fc9.i386.rpm
    * http://dev.dairylogic.com/synaptics/synaptics-0.14.6-7.ff1.fc9.src.rpm
     
    Dolph, Sep 5, 2008
    #1
  2. Dolph

    woogal

    Joined:
    Sep 1, 2008
    Messages:
    36
    Likes Received:
    0
    The Fedora 8 package isn't working for me. I've set all the xorg options and tweaked fingerwidth but nothing is producing a middle or right click.
     
    woogal, Sep 5, 2008
    #2
  3. Dolph

    Dolph

    Joined:
    Sep 5, 2008
    Messages:
    3
    Likes Received:
    0
    Location:
    London, UK
    Apologies - it looks like a mistake on my part in the RPM spec file for the Fedora 8 package meant that my patch wasn't being applied.

    I've uploaded an updated version of the F8 package - http://dev.dairylogic.com/synaptics/synaptics-0.14.6-2.ff2.fc8.i386.rpm (this link now appears in the original post above) - and I've successfully tested this one on someone else's AA1 that is running Fedora 8. However, we did also have to add "TapButton2" and "TapButton3" options to the xorg.conf file in addition to the package update.
     
    Dolph, Sep 6, 2008
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.