summaryrefslogtreecommitdiff
path: root/docs/gestures.txt
diff options
context:
space:
mode:
Diffstat (limited to 'docs/gestures.txt')
-rw-r--r--docs/gestures.txt58
1 files changed, 58 insertions, 0 deletions
diff --git a/docs/gestures.txt b/docs/gestures.txt
new file mode 100644
index 0000000..5a1eb45
--- /dev/null
+++ b/docs/gestures.txt
@@ -0,0 +1,58 @@
1Introduction
2------------
3
4This document describes how the gestures are extracted from multi-finger
5actions. The process is divided into gestural transformations, gesture
6recognition, and gesture instantiation.
7
8Gestural Transformations
9------------------------
10
11All two-finger transformations are extracted. These are all exact, in the
12sense that continuously transforming the original finger positions, frame
13per frame, will exactly follow the actual finger positions.
14
15In addition to two-finger transformations, a global gesture is also
16extracted. The rotation and scaling is taken from the contact pair with the
17longest distance between contacts. This approximates the behavior of a
18region, such that complex transformations could, in principle, be happening
19inside the region, but at a distance, the transformation will look like it
20was performed with two fingers.
21
22At each time step, a gestural transformation is goverened by rotation,
23scaling and translation. The point around which rotation and scaling is
24performed is called the pivot. To form as natural gestures as possible,
25this point always lies within the area formed by the contacts themselves.
26It is placed at the point which, after rotation and scaling, leaves the
27transformed contacts as close to the actual positions as possible. The
28translation, or drag, is always a fraction of the movement of the center
29point. The fraction is called moveness, and is related to the distance
30between the pivot and the center point. When the pivot is at the center
31point, the moveness is one and the drag is the same as the center movement.
32When the pivot is at one of the contacts, as in rotation around a finger,
33the moveness is zero, and consequently the drag is zero. The relations
34between the pivot, the moveness and the drag are detailed in the document
35pivot.txt.
36
37Gesture Recognition
38-------------------
39
40Each gestural transformation can give rise to one or several gesture
41primitives. Based on the rotation, scaling, moveness and drag values, the
42gesture primitives drag, pinch and rotate are recognized. The onset of a
43gesture primitive is governed by a threshold and a timeout. Basically, if
44performed distinctly enough, the gesture will be triggered, and will remain
45active until a finger is lifted or added.
46
47Gesture Instantiation
48---------------------
49
50Given a set of detected gesture primitives, only some will trigger actual
51gesture events. First, the set of available primitives are matched against
52available listeners. Primitives not listened for are dropped. The remaining
53set is arranged according to priority. A pointer gesture has lower priority
54than a two-finger gesture, which has lower priority than a tap, for
55instance. As long as the gesture primitives of higher priority are expected
56but not activated, all gestures are held back. Once one of the highest
57priority primitives are activated, all primitives of lower priority are
58cancelled, and events are emitted.