return "Tap";
else if(btn==GESTURE_TAP_2)
return "Two-finger tap";
+ else if(btn==GESTURE_TAP_3)
+ return "Three-finger tap";
else if(btn==GESTURE_DRAG)
return "Drag";
else if(btn==GESTURE_DRAG_2)
return "Two-finger drag";
+ else if(btn==GESTURE_DRAG_3)
+ return "Three-finger drag";
else if(btn==GESTURE_PINCH)
return "Pinch";
else if(btn==GESTURE_ROTATE)
pending_tap = GESTURE_TAP;
else if(btn==1)
pending_tap = GESTURE_TAP_2;
+ else if(btn==2)
+ pending_tap = GESTURE_TAP_3;
}
}
return;
invalid_gesture = false;
- if(points[1].down)
+ if(points[2].down)
+ {
+ bool same_direction = true;
+ for(unsigned i=0; (same_direction && i<2); ++i)
+ for(unsigned j=i+1; (same_direction && j<3); ++j)
+ {
+ TouchPoint &pi = points[i];
+ TouchPoint &pj = points[j];
+ same_direction = ((pi.x*pj.x+pi.y*pj.y)>2*abs(pi.x*pj.y-pi.y*pj.x));
+ }
+
+ if(same_direction)
+ current_gesture = GESTURE_DRAG_3;
+ }
+ else if(points[1].down)
{
TouchPoint &p2 = points[1];
float ddx = p.down_x-p2.down_x;
void GestureDetector::update_progress()
{
- if(current_gesture>=GESTURE_DRAG && current_gesture<=GESTURE_DRAG_2)
+ if(current_gesture>=GESTURE_DRAG && current_gesture<=GESTURE_DRAG_3)
set_gesture_delta(gesture_points(current_gesture));
else if(current_gesture==GESTURE_PINCH || current_gesture==GESTURE_ROTATE)
{