无法正确点击鼠标进行操作 [英] Can´t get mouse click to fucntion properly

查看:62
本文介绍了无法正确点击鼠标进行操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

鼠标移动正常,但当我将鼠标悬停在按钮上时,它不会点击。 任何建议为什么?这是我的这个函数的代码:

The mouse movement works ok but when I hover over a button it does not click. Any suggestion why? Here is my code for this function:

foreach (Skeleton s in allSkeletons) { Joint waistpoint = first.Joints[JointType.HipCenter]; _trackingswitch = ((first.Joints[JointType.HandRight].Position.Z < (waistpoint.Position.Z - 0.3)) && first.Joints[JointType.HandRight].Position.Y > waistpoint.Position.Y) ? true : false; if (_trackingswitch) { if (s.TrackingState == SkeletonTrackingState.Tracked) { var scaledHandRight = s.Joints[JointType.HandRight].ScaleTo(screenWidth, screenHeight, 0.5f, 0.5f); int xCoordinate = (int)scaledHandRight.Position.X; int yCoordinate = (int)scaledHandRight.Position.Y; if (lastY == 0) { lastX = xCoordinate; lastY = yCoordinate; } if (Math.Abs(lastX - xCoordinate) < threshold && Math.Abs(lastY - yCoordinate) < threshold) { if (Math.Abs(lastClick.Subtract(DateTime.Now).TotalSeconds) > 1) { Mouse.SendClick();

}

}

Mouse.MoveMouse(new Point(scaledHandRight.Position.X,scaledHandRight.Position.Y));

}
}
}

} Mouse.MoveMouse(new Point(scaledHandRight.Position.X, scaledHandRight.Position.Y)); } } }




推荐答案

您是否尝试过修改我的项目:
http://kinectmultipoint.codeplex.com
?或
http://kinectmouse.codeplex.com
项目(已完成鼠标点击,但右键点击但实施工作量不大右键点击)?

have you tryed modifying my project: http://kinectmultipoint.codeplex.com? or http://kinectmouse.codeplex.com project (already has mouse clicks done except right click but not much work to implement a right click)?

在我的项目中,我做了与kinect鼠标相同的事情,除了多人,并且将在笔记本软件上进行下一步仿真,并且右键点击易于实现也。有关笔记本电脑的详细信息,请访问:
http://smarttech.com  我在我的工作中使用笔记本电脑用于智能板,因为教师喜欢它我是设置它的IT人员。

In my project i do the same thing as kinect mouse except for multiple people and will be working on notebook software emulation next and a right click is a easy to implement also. For notebook software details visit: http://smarttech.com I use notebook at my work for smartboard because teachers like it and Im the IT guy that sets it up.


这篇关于无法正确点击鼠标进行操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆