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