public override void Process(HandCollection handData) { var fingerCount = handData.Hands[0].FingerCount; if (twoFingersDetected == null && fingerCount == 2) { twoFingersDetected = DateTime.Now; } if (fingerCount == 1) { twoFingersDetected = null; } if (twoFingersDetected.HasValue && DateTime.Now > twoFingersDetected.Value.AddMilliseconds(100)) { if (fingerCount == 2 && !this.mouseDown) { UserInput.MouseDown(); this.mouseDown = true; } } if (fingerCount == 1 && this.mouseDown) { UserInput.MouseUp(); this.mouseDown = false; } }
public override void Process(HandCollection handData) { var fingerCount = handData.Hands[0].FingerCount; if (fingerCount <= 1 && !this.mouseDown) { UserInput.MouseDown(); this.mouseDown = true; } if (fingerCount >= 2 && this.mouseDown) { UserInput.MouseUp(); this.mouseDown = false; } }
protected void MouseUp() { UserInput.MouseUp(); }