foreach (Joint jt in skel.Joints)
{
if (jt.JointType == JointType.HandRight)
{
textBox1.Text = "右手";
if ((dis - (jt.Position.X * jt.Position.X + jt.Position.Y * jt.Position.Y)) < 0.08 || (dis - (jt.Position.X * jt.Position.X + jt.Position.Y * jt.Position.Y)) > -0.08)
{
mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, (int)(jt.Position.X * 500000), -(int)(jt.Position.Y *100000), 0, 0);
dis = jt.Position.X * jt.Position.X + jt.Position.Y * jt.Position.Y;
}
//if (jt.Position.Z > 1.3)
//{
// textBox1.Text = " 1.9-1.6";
// keybd_event(0x57, (byte)MapVirtualKey(0x57, 0), 2, 0);
//}
//if (jt.Position.Z > 1 && jt.Position.Z < 1.3)
//{
// textBox1.Text = " 1.3-1.6";
// SendKeys.Send("{w}");
// SendKeys.Flush();
// keybd_event(0x57, (byte)MapVirtualKey(0x57, 0), 0, 0);
//}
}
//Console.WriteLine (jt.Position.Z);