捕获所有 Windows 7 触摸事件,而不仅仅是在我的窗体具有焦点时捕获
我有一个具有表单的应用程序,但它具有表单这一事实无关紧要。
使用这个应用程序,我需要监听所有操作系统级别的触摸事件。基本上,我需要捕获屏幕已被触摸的情况,无论哪种形式具有焦点,收集所有信息(如坐标等),然后对其进行任何操作。
实际上,我将通过 Windows 消息将其发送到另一个应用程序,但这也不相关。 我只需要知道如何监听和捕获所有操作系统级别的触摸+拖动事件等。
I have an application which has a form, but the fact that it has a form is irrelevant.
With this app, I need to listen to all Operating System level Touch events. Basically I need to capture that the screen has been touched no matter which form has focus, gather all the info like coordinates etc. and then do whatever with it.
I'll actually be sending it on to another app via a Windows Message but that's not relevant either. I just need to know how to listen and capture ALL OS level touch + drag events etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 原始输入API并自行解析它。
一般来说:
WM_INPUT
事件解析缓冲区上You can read HID data directly, using a Raw Input API and to parse it by yourself.
In general:
WM_INPUT
event parse buffer using HID API functions and preparsed data.此链接解释了键盘/鼠标事件挂钩的主题。
然而,这是一个相当高级的主题,充满了许多低级互操作。我会避免这样的任务并尝试为此提出不同的解决方案。您使用此应用程序的最终目标是什么?
This link explains the topic of keyboard/mouse event hooks.
It is a rather advanced subject however, filled with lots of low-level interop. I'd avoid such a task and try to come up with a different solution for this. What is your final goal with this application?