双击定时器事件
我正在开发一个应用程序,将用户的眼球运动与光标运动映射起来,从而开发一个免提光标控制系统。
我正在使用 Open CV 库的 .NET Wrapper for C# 即 Emgu CV 进行开发。
我被困在想要打开文件/文件夹的地方,这样当光标放在文件/文件夹上 3 到 5 秒时,文件/文件夹应该打开或只执行双击事件传统的鼠标。
我可以用什么来解决这个问题?
I am developing an application that maps users eye movements with the cursor movements, hence developing ahands free cursor control system.
I am using Open CV library's .NET Wrapper for C# i.e. Emgu CV for development.
I am stuck at a point where I want to open a file/folder such that when a cursor is placed over a file/folder for say 3 to 5 seconds, the file/folder should open up or just perform a double-click event of a conventional mouse.
What could I use so as to solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我想你需要将其分解:
对于1,我会查看:捕获 WM_MOUSEMOVE 如果您想要自己的定义'盘旋'。例如,对于您可以容忍的移动量有一个更大的阈值,但仍然将其视为“悬停”。或者,您可以使用操作系统定义的阈值并查找 WM_MOUSEHOVER
对于 2,SendInput 应该可以让你到达那里
我在这里假设,您实际上并不关心鼠标本身下方的内容。例如,您不会根据鼠标下方的内容执行不同的行为。例如,当您将鼠标悬停在标题栏上以及将鼠标悬停在文件上时,您将发送双击。
这篇文章关于项目构建了一个 Spy++ 风格的应用程序,这应该有帮助。
I guess you need to break it down:
For 1, I'd be looking at: capturing WM_MOUSEMOVE if you want your own definition of 'hovering'. For example, having a greater threshold for how much movement you'll tolerate and still consider it a 'hover'. Or, you could use the OS defined threshold and look for WM_MOUSEHOVER
For 2, SendInput should get you there
I'm assuming here, you don't actually care what's under the mouse per-se. As in, you're not going to do different behavior depending on what's under the mouse. For example, you'd send the double click when hovering over the titlebar, as well as if you were hovering over the file.
This article on project builds up a Spy++ style app, which should help.
您是否将目视控制映射到鼠标指针? MouseHover 事件可能有用:
http:// msdn.microsoft.com/en-us/library/system.windows.forms.control.mousehover.aspx
以及 MouseEnter、MouseLeave 等。
如果您控制的是单独的元素(即,不是鼠标)用眼睛,然后我必须在 WPF 中做类似的事情。最终归结为将控件坐标映射到鼠标位置,计算该控件范围内的时间,然后调用鼠标单击事件处理程序。
Are you mapping eye control to the mouse pointer? The MouseHover event may be useful:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.mousehover.aspx
As well as MouseEnter, MouseLeave, etc.
If you're controlling a separate element (i.e., not the mouse) with the eyes, then I had to do something similar in WPF. It ultimately came down to mapping control coordinates to mouse location, counting the time within the bounds of that control, then calling the mouse click event handler.