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