-
Hello, The title is the question. I compiled hidtest.exe and it can enumerate devices. I see my keyboard there and I placed its ID to the hid_open function. It then provides some details about the device, but some functions fail:
I heard that Windows allegedly has some limitations for HID keyboards and mices, but this project can work with my keyboard. Thus, it should be possible. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
P.S. In the enumerated list I see 3 or 4 entries for my keyboard. Does it matter? I mean if I need somehow to switch between them? If yes, then how can I do that? The hid_open function has optional 'serial' parameter, but it's the same for all entries related to the keyboard. @CalcProgrammer1, if I'm not mistaken, you had similar problem in past and you solved it by changing the Interface, right? |
Beta Was this translation helpful? Give feedback.
-
Windows creates a separate logical HID device for each (top-lelvel) usage_page/usage pair (see official doc: https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/top-level-collections).
By opening first device (usage_page/usage) there is a high chance you get the Keyboard collection and not the RGB, that's why you don't have access to read or write.
It searches for a specific usage_page/usage for each known device: 1, 2. |
Beta Was this translation helpful? Give feedback.
-
@Youw, thanks a lot for the explanation! So, what should I do:
Correct? Is it the simplest way? I did so and see that keyboard can react on my hid_write. Just want to make sure I should use |
Beta Was this translation helpful? Give feedback.
-
The last, I hope, question. The device still doesn't answer to |
Beta Was this translation helpful? Give feedback.
Windows creates a separate logical HID device for each (top-lelvel) usage_page/usage pair (see official doc: https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/top-level-collections).
hid_open
is not sufficient for this purpose. You need to usehid_enumerate
, and find a specific device with specific VID+PID+SerialNumber+USAGE+USAGE_PAGE.E.g.: HID_USAGE_PAGE_GENERIC/(HID_USAGE_GENERIC_MOUSE|HID_USAGE_GENERIC_KEYBOARD) is never allowed direct access using HIDAPI on Windows. That is an OS limitation.
By opening first device (usage_page/usage) there is a high chance you get the Keyboard …