Wednesday, April 6, 2011

twofing double click bug solved

Hey there,
    So even though nobody else was complaining about twofing double-clicking when it should only be single clicking, I've gone ahead and assumed that twofing is to blame. I messed around with my drivers but everything seemed ok.

So, I popped open gestures.c and looked through it. I added some debug prints at each of the fingerdown if statements and noticed that when I ran in debug mode (twfing --debug), nothing out of the ordinary was happening...
I press once and the finger down boolean switches to 1, when I lift my finger, the boolean goes back to zero...but two clicks appear to reach gnome. I remembered reading in the twofing doc that for interactions with non-special windows clicks are passed off to x...but the code on lines 509 to 516 looked suspicious:

  else if (fingersDown == 0 && fingersWereDown > 0) {
        /* Last finger released */
        if (hadTwoFingersOn == 0 && !isButtonDown()) {
            /* The button press time has not been reached yet, and we never had two
             * fingers on (we could not have done this in this short time) so
             * we simulate button down and up now. */
       
            pressButton();
            releaseButton();




So the comments there didn't make much sense to me but I went ahead and removed the last two statements which basically sent a (additional) mouse click.

Ran make and launched twofing and lo and behold no more double clicks for my single-click touches. Now I still need to run with this patch a little longer to confirm that it doesn't break anything but so far everything seems to be just perfecto...!


Monday, April 4, 2011

About twofing

Hey there. Haven't really had time to do this post but I'll dump a bunch of information here which I basically ripped off of this link: http://www.dadenjo.de/blog/wetabinstallationvonkubuntu

I'm going to assume that you have Ubuntu running on your WeTab and have configured the Multitouch driver properly as I've explained in earlier posts.

Now, download the latest twofing package...I worked with this one: https://help.ubuntu.com/community/T101MT?action=AttachFile&do=get&target=twofing-0.0.7.tar.gz

Unpack it somewhere and have alook at its content.

Install some needed libraries:
sudo apt-get install build-essential libx11-dev libxtst-dev libxi-dev x11proto-randr-dev libxrandr-dev

 Now open up the file 70-touchscreen-egalax.rules and change the Product ID to match the device ID you get from your lsusb output.

SYSFS{idProduct}=="72a1"

Finally run "make"
and then "sudo make install"

Now start twofing: twofing

If you want to run twofing at startup use the --wait flag in your call. (twofing --wait )

 So now you should be able to do some fun stuff like using twofinger to scroll up and down and so on. To be honest I haven't had much use for it really, especially because it converts all single finger touches to double-clicks which annoyed the heck out of me, but occasionally it will be useful if I need to use the mouse roller (brightness applet for ubuntu doesn't seem to work any other way...). I considered modifying the code to remove the double-click "feature" but then I didn't have that much time on my hands.

Cheers!