[libhid-discuss] libhid_interrupt_read returns same value for three keys
Alexander Juling
a_juling at rbg.informatik.tu-darmstadt.de
Wed Sep 23 11:38:18 UTC 2009
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.
>>
>> 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?
This is what I've done (left out all the initialization and error
receiving):
#define EP_HID_IN 0x81
#define PACKET_INT_LEN 10
char answer[PACKET_INT_LEN];
ret = hid_interrupt_read(hid, EP_HID_IN, answer, PACKET_INT_LEN, timeout);
printf("Returned: %d,%d,%d,%d,%d,%d,%d,%d.\n", answer[0], answer[1],
answer[2], .... , answer[7]);
Here ist the lsubs -v output.
Bus 001 Device 005: ID 07c0:0138 Code Mercenaries Hard- und Software GmbH
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x07c0 Code Mercenaries Hard- und Software GmbH
idProduct 0x0138
bcdDevice 10.98
iManufacturer 1 Code Mercenaries
iProduct 2 TEKWorx Limited interfaceIT CDU
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 34
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 4 HID Keyboard
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 1 Keyboard
iInterface 5 EP1 Int
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 80
Report Descriptor: (length is 80)
Item(Global): Usage Page, data= [ 0x01 ] 1
Generic Desktop Controls
Item(Local ): Usage, data= [ 0x06 ] 6
Keyboard
Item(Main ): Collection, data= [ 0x01 ] 1
Application
Item(Global): Usage Page, data= [ 0x07 ] 7
Keyboard
Item(Local ): Usage Minimum, data= [ 0xe0 ] 224
Control Left
Item(Local ): Usage Maximum, data= [ 0xe7 ] 231
GUI Right
Item(Global): Logical Minimum, data= [ 0x00 ] 0
Item(Global): Logical Maximum, data= [ 0x01 ] 1
Item(Global): Report Size, data= [ 0x01 ] 1
Item(Global): Report Count, data= [ 0x08 ] 8
Item(Main ): Input, data= [ 0x02 ] 2
Data Variable Absolute No_Wrap Linear
Preferred_State No_Null_Position
Non_Volatile Bitfield
Item(Global): Report Size, data= [ 0x08 ] 8
Item(Global): Report Count, data= [ 0x01 ] 1
Item(Main ): Input, data= [ 0x01 ] 1
Constant Array Absolute No_Wrap Linear
Preferred_State No_Null_Position
Non_Volatile Bitfield
Item(Global): Report Count, data= [ 0x05 ] 5
Item(Global): Report Size, data= [ 0x01 ] 1
Item(Global): Usage Page, data= [ 0x08 ] 8
LEDs
Item(Local ): Usage Minimum, data= [ 0x01 ] 1
NumLock
Item(Local ): Usage Maximum, data= [ 0x05 ] 5
Kana
Item(Main ): Output, data= [ 0x02 ] 2
Data Variable Absolute No_Wrap Linear
Preferred_State No_Null_Position
Non_Volatile Bitfield
Item(Global): Report Count, data= [ 0x01 ] 1
Item(Global): Report Size, data= [ 0x03 ] 3
Item(Main ): Output, data= [ 0x01 ] 1
Constant Array Absolute No_Wrap Linear
Preferred_State No_Null_Position
Non_Volatile Bitfield
Item(Global): Report Count, data= [ 0x06 ] 6
Item(Global): Report Size, data= [ 0x08 ] 8
Item(Global): Logical Minimum, data= [ 0x00 ] 0
Item(Global): Logical Maximum, data= [ 0xa4 0x00 ] 164
Item(Global): Usage Page, data= [ 0x07 ] 7
Keyboard
Item(Local ): Usage Minimum, data= [ 0x00 ] 0
No Event
Item(Local ): Usage Maximum, data= [ 0xa4 ] 164
ExSel
Item(Main ): Input, data= [ 0x00 ] 0
Data Array Absolute No_Wrap Linear
Preferred_State No_Null_Position
Non_Volatile Bitfield
Item(Global): Usage Page, data= [ 0x07 ] 7
Keyboard
Item(Local ): Usage Minimum, data= [ 0x00 ] 0
No Event
Item(Local ): Usage Maximum, data= [ 0xff ] 255
(null)
Item(Global): Logical Minimum, data= [ 0x00 ] 0
Item(Global): Logical Maximum, data= [ 0x7f ] 127
Item(Global): Report Count, data= [ 0x06 ] 6
Item(Global): Report Size, data= [ 0x08 ] 8
Item(Main ): Feature, data= [ 0x00 ] 0
Data Array Absolute No_Wrap Linear
Preferred_State No_Null_Position
Non_Volatile Bitfield
Item(Main ): End Collection, data=none
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Device Status: 0x0002
(Bus Powered)
Remote Wakeup Enabled
> _______________________________________________
> libhid-discuss mailing list
> libhid-discuss at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss
> http://libhid.alioth.debian.org/
>
>
More information about the libhid-discuss
mailing list