[libhid-discuss] libhid_interrupt_read returns same value for three keys

Charles Lepple clepple at ghz.cc
Wed Sep 23 11:52:17 UTC 2009


On Sep 23, 2009, at 7:38 AM, Alexander Juling wrote:

> Alexander Juling schrieb:
>> Charles Lepple schrieb:
>>> On Sep 16, 2009, at 4:42 AM, Alexander Juling wrote:
>>>
>>>> Unfortunately I got stuck now with a major problem. The keyboard  
>>>> is not in a standard keyboard body, so the labeling of the keys  
>>>> differs from a standard one. This won't be a problem unless three  
>>>> of the keys return the same result for the interrupt read  
>>>> function. Is there any way to differ the three key from each  
>>>> other? Unfortunately I cannot figure out, which keys they are  
>>>> originally.
>>>
>>> Is it possible that you need to send some additional information  
>>> to put the keyboard into a different mode?
>>>
>>> I don't know much about it, but HID keyboards have a "boot  
>>> protocol mode" which is supposed to be a simplified version of the  
>>> HID protocol.
>>

It does seem to have this mode:
"    bInterfaceSubClass      1 Boot Interface Subclass"

I don't think we have any functions in libhid for dealing with this,  
especially since the OS keyboard drivers may have initialized the  
keyboard already.

>>> What does 'lsusb -v' say for this keyboard?
>>>
>>>
>> I just need to know, which key is pressed and additional would send  
>> some information to the keyboard that will enable the caps-lock  
>> light or the num-lock light, but that seems to be another topic  
>> (even though it would be nice to receive an answer if you know it  
>> right now). The important part is, that three of the keys send back  
>> the same information back as it seems.
>>
>> I'm right now not at the office to send the lsusb -v, will do it  
>> tomorrow
>>
> I haven't done the hid_set_input_report(...) command before doing  
> hid_interrupt read. Could that be the problem?

Actually it's "hid_get_input_report()" and "hid_set_output_report()",  
but they get and set specific reports, whereas hid_interrupt_read()  
simply grabs whatever is next.

I haven't really done much with keyboards and mice, but you may need  
to look at hid_set_idle() and the corresponding "Set Idle" section of  
the HID Class spec (at usb.org).

The HID Class spec should also cover the Boot Protocol (in an  
appendix, IIRC).



More information about the libhid-discuss mailing list