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