Friday, April 24th, 2009

Mouse Gestures with GWT

Category: Flash, Fun, Gears, UI

Marc Englund wrote to us about his recent experiments with mouse gestures and GWT:

SimpleGesture is a GWT (and IT Mill Toolkit) implementation of the mouse gesture recognition method described by Didier Brun at (as I understand it). It allows you to register easy to understand (human readable) gestures, and receive events when these occur. Additionally, SimpleGesture can record new gestures, so that you don’t have to write them by hand.

In this video demo, he’s using a Wii to show it off (this confused me at first, but he’s using the Wii as a mouse and isn’t doing anything with the Wii-specific inputs):

You can also play with a live demo.

SimpleGesture relies on a bit of Flash to do its thing:

I have used the bytearray mouse gesture library for a Flash project before, and I love how simple the method is, and yet it works very well.
The method works by assigning a number depending on which direction the mouse moves in (moving right will produce “0”, moving down will produce “2”, and so on), and comparing the resulting string of numbers to the registered gestures. The gesture with the lowest Levenshtein distance (and below a set threshold), is considered a match.

Posted by Ben Galbraith at 9:00 am

3.7 rating from 28 votes


Comments feed TrackBack URI


Comment by devjamie — April 24, 2009


Comment by mattprokes — April 24, 2009

One clarification: it does not use any Flash, it is all GWT (written in Java, run as JavaScript). The ‘original’ -project that inspired this uses Flash (AS, actually), hence the confusion. If someone needs a pure JavaScript version, let me know…

And yup, the Wii controller is only used as a mouse, I’m not using any special features. It’s suitably imprecise to show of the usefulness of the gesture recognition ;-)

I’ll update the blogpost to be more clear on these points.

Feedback – especially patches – are welcome :-)

Best Regards,

Comment by marc — April 24, 2009

I admit when I read about it it sounded dubious, but I watched the video and found it very cool!

Comment by AnM8tR — April 24, 2009

Tried Marc:s demo (at IT Mill offices couple of weeks ago) – using wii-mote to do server-side actions felt like being a wizard casting a spell with magic wand…

Comment by jole — April 25, 2009

Leave a comment

You must be logged in to post a comment.