0
\$\begingroup\$

I am currently working on a project in which I would like to be able intercept a specific key combination from a standard USB HID keyboard with a microcontroller. The purpose is to use the keyboard to control a peripheral while also being able to use the keyboard as input to a computer.

My thinking is that the peripheral will have a USB input for an HID keyboard, and a USB output, to send the keystrokes to the computer from the peripheral. I am fairly certain that it is not possible to have one keyboard be used with two devices simultaneously, so my thought is that the peripheral will have to intercept all keyboard input, and check for the key combination. Then, it would have to be able to be recognized as an HID by the computer, and send the input to the computer as an HID.

Is this correct? If so, is this feasible to do with a microcontroller like an XMEGA?

\$\endgroup\$
  • \$\begingroup\$ It is correct and it is feasible. \$\endgroup\$ – Leon Heller Apr 4 '14 at 17:43
  • \$\begingroup\$ Plenty of people have written up HID projects on small micros on the net, what have found/tried so far? \$\endgroup\$ – John U Apr 4 '14 at 17:43
0
\$\begingroup\$

Essentially what you want is a USB protocol sniffer. There are commercial ones but they can cost hundreds of dollars and they are usually designed to send information to a PC for a GUI interface. There are also software-only sniffers (some freeware) that run in Windows and show the USB traffic going into and out of a PC, but I gather that won't work for you either.

You should consider the BeagleBoard USBSniffer, which is an open source protocol sniffer. The host computer is connected to the slave USB port of the BeagleBoard, and the device to be sniffed on the host USB port. It then logs the data going over the USB ports. You could modify the logging routine to fit your needs.

It has been tested with a Logitech keyboard.

\$\endgroup\$
  • \$\begingroup\$ Thank you @tcrosley, this is very much like what I'm looking for. I may start with the software only options to see if I can get enough information to lead me in the right direction, and make my way to the BeagleBoard USBSniffer. \$\endgroup\$ – derek.cormier Apr 4 '14 at 23:52
  • \$\begingroup\$ @derek.cormier This page lists several software-only USB protocol analyzers. \$\endgroup\$ – tcrosley Apr 4 '14 at 23:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.