Here is a complete framework to make gestures with the mouse (or touch) to perform some action. Its a Xojo translation (with some additions) of the work of Dr Per Ola Kristensson. The engine can recognize user build gestures on the fly.
You can find the full source code on my blog:
http://alwaysbusycorner.wordpress.com/2014/04/02/xojo-mouse-touch-gestures-engine/