PyMT is an open source library for developing multi-touch applications. It is completely cross platform (Linux/OSX/Win) and released under the terms of the GNU LGPL.

It comes with native support for many multi-touch input devices, a growing library of multi-touch aware widgets, hardware accelerated OpenGL drawing, and an architecture that is designed to let you focus on building custom and highly interactive applications as quickly and easily as possible.

Since PyMT is a pure Python library, you can take advantage of its highly dynamic nature and use any of the thousands of high quality and open source python libraries out there.

Once you have installed the python-pymt package in Ubuntu, you can try the following command which will fail as there is no example configuration file yet:

$ python -m

In PyMT 0.5.1 (which will be included in Maverick when released) the configuration and device detection will be automatic, but for now this requires manual configuration.

Once the above command fails, you will be able to edit the ~/.pymt/config file. The last portion of that file should look like this:

#default = tuio,
#mouse = mouse

The configuration will be automatic in the final released version and would be like this:

%(name)s = probesysfs
#default = tuio,
#mouse = mouse

In this example we use /dev/input/event7 which has been obtained by using lsinput from the input-utils package. Here is an example output for the Apple Magic Mouse (other irrelevant input devices removed):

$ sudo lsinput

   bustype : BUS_BLUETOOTH
   vendor  : 0x5ac
   product : 0x30e
   version : 352
   name    : "Apple Wireless Trackpad"
   phys    : "XX:XX:XX:XX:XX:XX"
   uniq    : "XX:XX:XX:XX:XX:XX"
   bits ev : EV_SYN EV_KEY EV_REL EV_MSC

You can also find the input device assigned to your hardware by looking at the Xorg log. In a terminal window you can use the following command:

tail -f -n 30 /var/log/Xorg.0.log

Input devices in Ubuntu require proper permissions to be used. Information on how to accomplish this will be available shortly, however you can run the above demo as the admin user:

$ sudo python -m

Placing several fingers on your mouse should yield something similar to this:


Run examples from PyMT

PyMT come with an integrated multitouch desktop, made for multi-user. You can test it by running the launcher :

$ cd /usr/share/pymt-examples/
$ sudo python

Check the /usr/local/share/pymt-examples/, some applications are not available inside the browser. You've also lot of examples that cover part of the framework.


Multitouch/PyMT (last edited 2010-10-04 01:18:50 by maisel-gw)