Extending gesture support in Eclipse

With the release of Eclipse 3.7 the SWT team added support for touch and gesture events. Gesture support can be a bit tricky. So much that to solve this; scientists develop intricate algorithms and give them names.

Currently Eclipse supports the following gestures.

  • SWT.GESTURE_MAGNIFY
  • SWT.GESTURE_PAN
  • SWT.GESTURE_ROTATE
  • SWT.GESTURE_SWIPE

Now this set is about what most operating systems have. But would it not be cool if we could have separate, configurable gestures for Debug Launch, Next Annotation, switch to Mylyn Perspective and so on? I started imagining a preference page similar to the General > Keys page but with a wide range of gestures instead of key combinations.

Thankfully the guys that wrote the paper linked to above actually did something about that. They developed a framework named iGesture and released it under the Apache 2.0 license. As their web-page states:

“iGesture supports the application developer who would like to add new gesture recognition functionality to their application as well as the designer of new gesture recognition algorithms. The iGesture framework can easily be configured to use any of the existing recognition algorithms (e.g. Rubine, SiGeR) or customised gesture sets can be defined.”

So you can design your own gestures (or take advantage of predefined ones) and use them in your application. That was almost to good to be true, but I decided to give it a go and downloaded the whole shebang. At the first go it crashed because I’m not using a Windows computer and the mouse device won’t work otherwise. Good thing they know a thing or two about API design so I set about to write a SWTInputDevice (with friends) to solve the issue.

A couple of hours later we have a very simple (and slightly buggy) SWT application that blends the new touch support in Eclipse 3.7 with iGesture and is actually able to detect a few custom gestures. It needs a lot more work to be useful, but I think it’s a decent proof of concept.

Now what to do in the summer vacation…

2 Comments

  1. Thanks David. Not as such. This summer vacation I somehow ended up refurbishing the basement living room instead. However I have a customer that is very interested in using gestures for input to an RCP application that will be used to simulate sub-sea drilling operations, so I suspect I'll be doing some more work on it soon. iGesture still looks good, but it will need quite some work in order to be used on Linux/OSX hosts. Hopefully something exists that will not force us to spend a lot of time on the framework. It could be the existing gesture set is sufficient for what we need though.

    I noticed that the link to the SWT application mention did not work. Will amend that. The code should be around here somewhere.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.