Search code examples
inputwindowhidwndproc

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? 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?

In an ideal scenario, I'd just look for the list connected devices, and ask for the input reading of the device I need.


Solution

  • You can use (possibly overlapped - for async reads) ReadFile on a HID device file handle. See Obtaining HID Reports article and HClient sample application that is doing both - enumerating devices and reads from them. It is doing that without WM_INPUT/Raw Input API.