[chimera-dev] Code source for Multi-touch

David Konerding dakoner at gmail.com
Tue May 20 15:03:02 PDT 2008

> So a couple of questions arise.
> Would it be possible to have the entire source code? We are ready to sign an
> NDA or any other contract if necessary. I am asking this because I am having
> difficulties to imagine how we could make the changes without being able to
> check how it works in the program. If there is a way to do it rapidly then
> of course we won't need the entire code source.
> The library that handles the touch events (touchDown, touchUpdate,
> touchRemove) is written in C++ (would wrap it of course). It gives basically
> the coordinates of the touches and updates the coordinates when dragging the
> finger. So we would need to replace mouse events with those and make
> zooming, translating and rotating functions available by using only the
> fingers. We would also make a new menu bar with only a couple of functions
> to be able to demonstrate the concept.


I implemented a multi-touch interface using the iPhone controller Chimera.

For what you're describing, you don't need the C++ source code, just
the Python code.

Here's what I did.  I embedded a threaded web server in Chimera using
the standard Extension
mechanism.  That web server receives external multi-touch interface
events and converts
them to Chimera Python code.  In your case, you would wrap your C++
event library in Python instead of
using a web server.

Here's an example when touch info comes in.  RecordPosition gets
called when a user presses down on the
iPhone.  TranslateXYCommand gets called when user drags 1 finger.
ScaleXYCOmmand gets called when user pinches
or expands two fingers.

        elif isinstance(item, RecordPositionCommand):
            chimera.viewer.recordPosition(time.time(), int(item.x),
int(item.y), None)
        elif isinstance(item, TranslateXYCommand):
            chimera.viewer.translateXY(int(item.x), int(item.y), False)
        elif isinstance(item, ScaleXYCommand):
            chimera.viewer.zoom(int(item.x), int(item.y), False)


More information about the Chimera-dev mailing list