1 #ifndef MSP_INPUT_GESTUREDETECTOR_H_
2 #define MSP_INPUT_GESTUREDETECTOR_H_
22 Interprets events from a Touchscreen as high-level gestures. One button is
23 provided for each type of gesture. Axes 0 and 1 indicate the starting position
24 of the gesture; axis 2 tracks its progress. The progress axis may exhibit
25 absolute values greater than one.
27 class GestureDetector: public Device
42 bool threshold_exceeded;
47 Touchscreen &touchscreen;
48 TouchPoint points[MAX_POINTS];
49 Gesture current_gesture;
50 unsigned active_points;
56 GestureDetector(Touchscreen &);
58 virtual std::string get_button_name(unsigned) const;
59 virtual std::string get_axis_name(unsigned) const;
62 void touch_down(unsigned);
63 void touch_up(unsigned);
64 void touch_move(unsigned, float, float);
66 void update_progress();
68 void window_resized(unsigned, unsigned);