twofing
twofing is a daemon which runs in the background and recognizes two-finger gestures performed on a touchscreen and converts them into mouse and keyboard events. This way, such gestures can be used in almost all existing applications (even ones where you wouldn’t expect it, like Wine applications) without having to modify them.
twofing is only an intermediate step which is necessary until proper multitouch support along the whole software stack of a typical Linux-based system is available. It reads raw multitouch events from the kernel, bypassing X, and has to do some dirty things like grabbing the input device so the multi-touch actions are not passed to the applications as normal mouse events. It can hopefully be replaced one day by a proper multitouch framework (like uTouch promises to become). But for now, it works reliably, is surprisingly stable and provides some advanced features, like kinetic scrolling.
Wanna contribute?
You find twofing on github: http://github.com/Plippo/twofing
Or clone the repository right now: git clone http://github.com/Plippo/twofing
Features
twofing currently recognizes the following two-fingered gestures: Two-fingered tap, two-fingered scroll, two-fingered zoom, two-fingered rotate. It blocks input so these gestures don't reach the underlying application as normal mouse events. It creates mouse and key events and sends them to the application instead. To be able to do this, the daemon needs different profiles for different applications. Here is what should work at the moment:
- Eye of Gnome (Ubuntu's default picture viewer): Zoom, scroll, rotate, right click
- Evince (Ubuntu's default document (PDF) viewer): Zoom, scroll, rotate, right click
- F-Spot: Zoom, scroll, right click
- Almost every other application: Scroll, right click, for many (like Firefox, Nautilus, LibreOffice/OpenOffice) also zoom
Unfortunately, applications which use extended input capabilities like Gimp, Xournal or MyPaint don't work correctly with the daemon if extended input is enabled in these applications.
Try it out
twofing currently only works with the eGalax touchscreen of the Eee PC T101MT. How easy it would be to adapt it to other devices depends on the device; for many, simply altering the udev rule should be enough. As I don’t have any other hardware to test it, I can’t currently do anything about that. If you want to make it work with a different device, please feel free to send me a message.
To use twofing on your T101MT, please perform the following steps:
- Download twofing-0.0.9a.tar.gz
- Extract it to a folder of your choice (e.g. your home dir)
- Open a terminal and navigate to the extracted folder (e.g. cd ~/twofing-0.0.9a if you extracted it to your home dir)
- Install the required packages:
sudo apt-get install build-essential libx11-dev libxtst-dev libxi-dev x11proto-randr-dev libxrandr-dev
- Compile the daemon by calling
make
- Install the daemon by calling
sudo make install
- Reboot
- Open a terminal again and call
twofing
(nothing will seem to happen) - Open your favourite application and perform gestures on the screen with two fingers
- Enjoy
To stop the daemon, simply call killall twofing
Add the command twofing --wait
to your startup programs to make twofing start automatically after login.