HID device information structure from GetRawInputData

Where can I get the structure for the HID device?

For instance:

raw data from a device, using GetRawInputData: ( 0 137 117 0 146 130 24 128 0 ) ( 0 137 117 0 146 130 8 128 0 ) /\ at this I can see that || there is being a button released that means, at the 6-th char at 4-th bit 

By analyzing the raw stream, I can find out where the buttons, switches, and analog data are. Is there any way to request this information from Windows.

My main goal is to get the structure:

 Button - 6th char, 4th bit. Analog - 2nd char Switch - 6th char, 0-3th bit. 

The only solution I found was HID Descriptors . But I'm not sure how to use them. After reading the documentation, it seemed to me that I ran into a brick wall. Here maybe a good example of how to use them or a book that describes them better. (Or an easier way to do this without descriptors)


I found HidP_GetButtons and HidP_GetUsages , but still don't know how to extract the structure (as described above).

+4
source share
2 answers

Oh, you have to use GetRawInputData . There is a few crummy example in msdn.

0
source

The problem is that each device has its own structure. There seems to be no universal way through win32 api to get an interpretation of the structure.

Combination

You seem to get all the information you can get from win32.

After that, you will probably need an external source of information (or one generated by you) that describes specific fields, etc.

0
source

Source: https://habr.com/ru/post/1300622/


All Articles