From 296cc6e9d0fe0d69045cb288f9f470f3760c4a43 Mon Sep 17 00:00:00 2001 From: Chase Douglas Date: Mon, 14 Feb 2011 16:35:13 +0100 Subject: Add in time boundaries for recognition 50 ms: Minimum time waiting for touch configuration to settle before flushing touch events to X. We don't want a two finger gesture triggering X events for the first finger before the second finger lands. 200 ms: Maximum time for touches to begin a gesture. If no gesture is found within this time period, the events are flushed to X. If after 50 ms there are no possible gestures for the number of active touches, the events are immediately flushed to X. If events are flushed to X, no more gesture recognition is possible until all touches are lifted. Likewise, if any gesture is recognized, no events may be flushed to X until all touches are lifted. [rydberg@euromail.se: this patch is severely restrictive and not final] Signed-off-by: Chase Douglas Signed-off-by: Henrik Rydberg --- src/grail-recognizer.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/grail-recognizer.h') diff --git a/src/grail-recognizer.h b/src/grail-recognizer.h index 56e5b8d..b08ff34 100644 --- a/src/grail-recognizer.h +++ b/src/grail-recognizer.h @@ -25,6 +25,12 @@ #include "grail-gestures.h" +enum recognition_state { + RECOGNIZING, + RECOGNIZED, + UNRECOGNIZED +}; + struct gesture_recognizer { struct move_model move; struct combo_model drag; @@ -34,6 +40,8 @@ struct gesture_recognizer { struct combo_model winpinch; struct combo_model winrotate; struct tapping_model tapping; + utouch_frame_time_t start_time; + enum recognition_state state; }; int gru_init(struct grail *ge); -- cgit v1.2.3