The ‘Gestures’ paradigm was introduced a few years ago for internet browsers and became quite popular. Tablet PC platform also recently added ‘gestures’ recognition to its arsenal. But I always thought that this functionality could be really valuable for the Pocket PC platform as well: it has a touch screen, limited screen space and is a perfect candidate for improving user interoperability of our applications. So, how can we implement the ‘gestures’ in NET CF? vbAccellerator has had this whitepaper explaining how it could be done for .NET. He implements the IMessageFilter to hook up into application’s message loop and catch all mouse messages. When the ‘MouseDown’ message is received he starts collecting the mouse coordinates and on ‘MouseUp’ would stop collecting and interpret the collected data. I’ve ported this code to NET CF utilizing the Application2 functionality from the SDF v2. Here is the screen shot of the sample application:
This code implements recognition of a very simple gestures like moving up or down, left or right, left and then up etc… If you want to implement recognition of more complex gestures, you would need to resort to more sophisticated methods like neural networks. Codeproject.com has a few interesting articles on this subject. Many of these could be easily ported to CF.
But even having been able to recognize the gestures provided by this implementation can add a lot more usability to your Pocket PC applications. Move your stylus to the right and you can switch to the next screen. ‘Down’ – and you can scroll the form or the ListBox or Grid etc…
Remember Me
Powered by: newtelligence dasBlog 1.8.5223.2
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
© Copyright 2008, Alex Yakhnin