The Multitouch Aquaria Project

Introducing TouchViz

Thursday 2011-03-31

I have been fairly busy with classes the last week and haven’t accomplished much on Aquaria itself. However, as a way to learn the GEIS library I have begun writing a tool I call TouchViz. The purpose of this tool is to provide a screen overlay with the details of GEIS-detected touches and gestures while allowing full interaction with another program. I’m not sure that this is achievable at this time — I haven’t yet figured out if GEIS can observe events without capturing them — but the project will be a valuable experiment even if it turns out to be nothing more than a pretty GEIS demo.

I am using PyGTK (with Cairo for drawing), and the python-geis bindings. The Python bindings are pretty immature (and won’t be ready for Natty’s release according to discussion in #ubuntu-touch). The most egregious flaw I have come across is a segfault when deallocating an Event object. Fortunately this can be worked around by using a single global Event such that it is only freed when the program terminates (you can observe the SIGSEGV in the video below).

An early version of TouchViz

This video demonstrates TouchViz’s current status. Single touches are displayed as translucent green circles and track the finger as it moves. When the touch ends, a red circle remains in its final position (these will eventually fade away).

Because the code currently expects a touch end event for every touch it tracks lots of touches end up sticking around as green dots after they have actually ended. I’m probably using the wrong information to draw them — fixing this is my next objective.

When more than one finger is depressed everything goes wonky, resulting in the green streak in the bottom-left. I’m not sure what’s going on there, but being able to figure that out in Python, without the overhead of compiling and loading Aquaria, is going to make TouchViz fully worthwhile.

You can find the source on Github.