如何实现双击?
让我解释一下我们正在做什么:
我们设计了一个可以放置在屏幕周围的红外传感器/接收器框架,基本上它将屏幕转换为非触摸屏。当用户在框架内移动手指时,我们可以移动鼠标光标,并且我们还可以生成右键单击,只需查看用户是否将他/她的手指放在相同的坐标上 x 时间,然后生成右键单击。
问题是双击。使用普通鼠标,用户只需双击按钮即可完成。关于如何实现这一目标有什么想法吗?
谢谢。
Let me explain what we are doing:
We have designed a frame of ir sensors/receivers that can be put around a screen, and basically it converts the screen into a touch-less screen. We are able to move the mouse cursor around when the user moves his finger inside the frame and we can also generate a right click, simply by seeing that if the user is holding his/her finger over the same coords for x amount of time then generate a right click.
The problem is double click. With a regular mouse a user simply double clicks the button and done. Any thoughts on how this can be achieved?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要确定手指是否在屏幕内;一旦你有了一个告诉你这一点的机制 - 你可以检查这个序列:
时间 0:(手指离开屏幕)
时间1:(手指触摸P1)
时间 2:(手指离开屏幕)
时间 3:(手指触摸 P2)
其中 P1 和 P2 接近(达到预设容差级别),时间 3 和时间 1 接近(达到预设双击灵敏度级别)。
You would need to figure out if the finger is within the screen at all; once you've got a mechanism that tells you that - you can check for this sequence:
Time 0: (finger off screen)
Time 1: (finger touches P1)
Time 2: (finger off screen)
Time 3: (finger touches P2)
where P1 and P2 are close (up to a preset tolerance level) and Time 3 and Time 1 are close (up to a preset double-click sensitivity level).
解决方案是对右键单击和双击使用不同的计时器。当您将手指放在可点击元素上时,手指位置会出现一个圆形进度条,当进度到达终点(圆圈完成)并且用户将手指移开时,会检测到右键单击。如果用户没有移开手指,则会出现一个不同的进度条,如果该进度条达到 100%,则您可以双击。
在我看来,更好的解决方案是不需要需要双击,甚至右键单击,请查看 XBox Kinect 菜单导航界面以获得一个很好的示例。
希望有帮助。
问候。
A solution would be to use different timers for Right click and double click. When you place the finger over a clickable element, a circular progress bar appears at the position of the finger, when the progress reachs the end (the circle is complete) and the user moves the finger away a right click is detected. If the user doesn't move away the finger, a different progress bar appears, if that progress bar reachs 100%, then you have a double click.
In my opinion, a much better solution would be to NOT need a double click, or even a right click, check the XBox Kinect menu navigation interface for a good example.
Hope it helps.
Regards.