简体   繁体   English

您可以在没有 WM_INPUT 消息的情况下立即获取 Windows 原始输入数据吗?

[英]Can you get Windows raw input data immediately without WM_INPUT messages?

So can I get input data of a given device without the need to receive a WM_INPUT message altogether?那么我可以在不需要完全接收 WM_INPUT 消息的情况下获取给定设备的输入数据吗? Is there a function in Windows API that allows me to ask about the last input reading of a given device without involving a WNDPROC for message processing, and ideally without a window, and without device registration? Windows API 中是否有一个函数允许我询问给定设备的最后输入读数,而不涉及用于消息处理的 WNDPROC,理想情况下没有窗口,也没有设备注册?

In an ideal scenario, I'd just look for the list connected devices, and ask for the input reading of the device I need.在理想情况下,我只需查找已连接设备的列表,并询问我需要的设备的输入读数。

You can use (possibly overlapped - for async reads) ReadFile on a HID device file handle.您可以在 HID 设备文件句柄上使用(可能重叠 - 用于异步读取) ReadFile See Obtaining HID Reports article and HClient sample application that is doing both - enumerating devices and reads from them.请参阅获取 HID 报告文章和同时执行这两项操作的HClient 示例应用程序- 枚举设备并从中读取。 It is doing that without WM_INPUT /Raw Input API.它在没有WM_INPUT /Raw Input API 的情况下这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM