views:

1662

answers:

1

I am trying to interact with a keyboard with pyusb but I can't find any documentation or tutorial for it. The project homepage has absolutely no information and the installed README file is pretty useless. There is no man page. I found mailing lists but the people there have way more advanced problems than me.

The only useful thing I found so far is the sample subdirectory in the source. There is an usbenum.py which seems straightforward it does something like lsusb. I know what an USB bus or a device is but what exactly "Configuration", "Interface", "Alternate setting" and "Endpoint" mean? Some general USB information is also welcome.

The usbprint.py tells me that I can use a device with controlMsg, bulkRead and bulkWrite but what is the meaning of their parameters? Are there any other functions? Are the constants used specific to the printer? Is there a risk of damaging any hardware if I do something wrong?

The best thing would be a step-by-step guide for using some simple hardware and a detailed description of all the functions.

The problem I am trying to solve is described on superuser: http://superuser.com/questions/13120/how-can-i-get-usb-keyboard-extra-buttons-working Please take a look at it. If there is an easier way to solve that problem then I have no intention of doing this. My own answer there may tell something about my level of understanding in this topic.

Thank you.

+2  A: 

Well from what I can see it is an fairly thin ctype wrapper around libusb, so I would start there: http://libusb.sourceforge.net/api-1.0/

Martin P. Hellwig
This looks good. Thanks.
stribika