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.
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…