Recently I thought about image-processing algorithms. There, I found a possible solution on how to implement mouse-gestures which don't just separate horizontal and vertical movements. What do you think about it, where does it need improvement? 1. Segmentation. The angle of movement on the XY-plane gradually increases or decreases. (Differential, Integral) Find the toggle points and create segments between them. 2. Finding cross-overs (hard segment breakers). 3. Creating the hierarchy. Every segment-delimiter has an angle between the next and previous segment and a distance to the previous and next delimiters. –––Delimiter––<segment>––Delimiter––<segment>––Delimiter––– If the distance is low, cut segments with low-angle delimiters by merging delimiters toward the position of the one with a higher angle. Never cut delimiters created by cross-overs(2) - these are defining the shape. Never cut delimiters with a similar angle - these are siblings. The cut segments are childs of a delimiter, this is how you create the hierarchy. The delimiters with a similar angle should be siblings in a hierarchy-level now. 3. Naming the shape. The order of delimiters and their number of child-segments is like a unique music pattern. Find the name/entry which is defined by a similar pattern and variations of it. 4. Pattern recognition. The basic idea here is to create a hierarchical database similar to the ZIP-compression's translation tables with hyper-linked entries. Perhaps the words are not good ones - I haven't thought much about how to describe it in english.