简体   繁体   中英

RegisterRawInputDevices function usage

I have several questions about RegisterRawInputDevices() function. 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? I couldn't find any examples.

On MSDN every parameter of function is input parameter I didn't see any output parameter for monitoring.

You must catch WM_INPUT in the WindowProc callback function. https://msdn.microsoft.com/en-us/library/windows/desktop/ms633573(v=vs.85).aspx

And retrieve the RAWINPUT structure, which contains the raw input from the device. https://msdn.microsoft.com/en-us/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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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