简体   繁体   English

RegisterRawInputDevices函数的用法

[英]RegisterRawInputDevices function usage

I have several questions about RegisterRawInputDevices() function. 我对RegisterRawInputDevices()函数有几个问题。 I mean obviously it is for registering raw input device but the real question is how can I use that registered raw input device? 我的意思是显然是用于注册原始输入设备,但真正的问题是如何使用该注册的原始输入设备?

Can I monitor WM_INPUT messages with this device? 我可以使用此设备监视WM_INPUT消息吗? I couldn't find any examples. 我找不到任何例子。

On MSDN every parameter of function is input parameter I didn't see any output parameter for monitoring. 在MSDN上,函数的每个参数都是输入参数,但没有看到任何要监视的输出参数。

You must catch WM_INPUT in the WindowProc callback function. 您必须在WindowProc回调函数中捕获WM_INPUT https://msdn.microsoft.com/en-us/library/windows/desktop/ms633573(v=vs.85).aspx https://msdn.microsoft.com/zh-CN/library/windows/desktop/ms633573(v=vs.85).aspx

And retrieve the RAWINPUT structure, which contains the raw input from the device. 并检索RAWINPUT结构,其中包含来自设备的原始输入。 https://msdn.microsoft.com/en-us/library/windows/desktop/ms645562(v=vs.85).aspx https://msdn.microsoft.com/zh-CN/library/windows/desktop/ms645562(v=vs.85).aspx

Maybe this link will help you. 也许此链接会为您提供帮助。 Just remember that the questioner in this link went wrong. 只需记住此链接中的发问者出了错。 You need to read comment to get the right way. 您需要阅读评论以获取正确的方法。 Get WM_INPUT from Unity window 从Unity窗口获取WM_INPUT

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

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