1 #ifndef MSP_INPUT_GESTUREDETECTOR_H_
2 #define MSP_INPUT_GESTUREDETECTOR_H_
25 Interprets events from a Touchscreen as high-level gestures. One button is
26 provided for each type of gesture. Axes 0 and 1 indicate the starting position
27 of the gesture; axes 2 and 3 track its progress. The progress axis may exhibit
28 absolute values greater than one.
30 class GestureDetector: public Device
45 bool threshold_exceeded;
50 Touchscreen &touchscreen;
51 TouchPoint points[MAX_POINTS];
52 Gesture current_gesture;
59 GestureDetector(Touchscreen &);
61 std::string get_button_name(unsigned) const override;
62 std::string get_axis_name(unsigned) const override;
65 void touch_down(unsigned);
66 void touch_up(unsigned);
67 void touch_move(unsigned, float, float);
69 void set_gesture_location(unsigned);
70 void set_gesture_delta(unsigned);
71 void update_progress();
73 void window_resized(unsigned, unsigned);
77 unsigned gesture_points(Gesture);