Commit b043fe24 authored by Alexander Krause's avatar Alexander Krause

fixed ghost click after dragging

parent c8cff2e1
......@@ -142,7 +142,7 @@ namespace ExplorVizGestureControl.Gestures
if (GestureDatabase.ZoomingInitialized())
{
zoomingActive = true;
zoomingActive = true;
if (distance >= 0 && GestureDatabase.BothHandsClosed())
{
......@@ -169,7 +169,7 @@ namespace ExplorVizGestureControl.Gestures
{
zoomingActive = false;
zoomStatus = 0;
scrollTimer.startTimer();
scrollTimer.startTimer();
}
}
......@@ -179,23 +179,14 @@ namespace ExplorVizGestureControl.Gestures
if (!GestureDatabase.RightHandClosed() && selectionStatus == 1)
{
selectionStatus = 2;
}
if (!GestureDatabase.RightHandClosed() && selectionStatus == 2)
{
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
selectionStatus = 0;
selectionStatus = 2;
}
/* if (!GestureDatabase.DragObject() && selectionStatus == 3)
if (!GestureDatabase.RightHandClosed() && selectionStatus == 2 && !gripActive)
{
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
//Thread.Sleep(150);
// mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
selectionStatus = 0;
}*/
}
if (GestureDatabase.RightHandClosed())
{
......@@ -208,16 +199,14 @@ namespace ExplorVizGestureControl.Gestures
float vLength = GestureDatabase.CalculateVectorLength(GestureDatabase.Joints[(int)JointType.HandRight]);
if (selectionStatus == 2) selectionStatus = 3;
// If hand position didn't change 1 cm (in x, y or z), do no more processing for this frame
if (Math.Abs(rightHandAnchorLength - vLength) < 0.01f) return;
// If hand position didn't change 1.5 cm (in x, y or z), do no more processing for this frame
if (Math.Abs(rightHandAnchorLength - vLength) < 0.015f) return;
// Else handle grip processing
if (!gripActive)
{
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
gripActive = true;
gripActive = true;
}
double distanceX = GestureDatabase.Joints[(int)JointType.HandRight].X -
......@@ -231,11 +220,13 @@ namespace ExplorVizGestureControl.Gestures
Cursor.Position = new Point(Cursor.Position.X, Cursor.Position.Y) + new Size(moveX, -moveY);
}
else if (gripActive)
{
{
selectionStatus = 0;
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
//selectionStatus = 0;
gripActive = false;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment