A big part of my doctoral research [1] was developing novel methods for pattern recognition and movement analysis. I developed a C++ library which could be used for pattern recognition in any modality - body movement, speech, or mouse gestures.
Golf swing training and tracking:
Recognition of several trained gestures (first video shows each gesture executed two times so you can get a sense of what the gestures are):
An example app that can be trained to learn and recognize mouse movement gestures:
References
[1] Stjepan Rajko. 2011. Probabilistic Graphical Models for Pattern Recognition and Optical Motion Capture Tracking. Proquest, Umi Dissertation Publishing.