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

Alexander Juling a_juling at rbg.informatik.tu-darmstadt.de
Wed Sep 16 08:42:27 UTC 2009


Hello everyone,

I'm quiet new in the topic of libhid. With the help of the libhid 
discuss list it was possible to connect to the device and receive the 
keys pressed via the hid_interrupt_read command.

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.

This is what I've done:
...
// Reading an interrupt
char answer[8];    // The result you get when a key pressed. Therefore 
find out which key
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[3],  answer[4], answer[5], answer[6], answer[7]);
...

It returns: "Returned: 1,0,0,0,0,0,0,0" for three of the keys.

Hopefully you could help me! Thanks a lot,

Alex





More information about the libhid-discuss mailing list