PDA

View Full Version : sending USB HID page 0xC key codes above 0xFF



ddrown
01-21-2013, 04:58 AM
Hello! I have a Teensy 2 using the Arduino environment. I want to use it to send key codes to an Android device. Specifically, I want to send keycode 0x223 (Android calls it KEYCODE_HOME) under the Consumer page (0xC). I also want to send a bunch of other keycodes under the consumer page. I hacked the hid code to assign one byte in the input report to keys 0x0-0xFF and eight bits mapped to eight keycodes above 0xFF. Is there a better way of doing this?

Here's my code:

https://github.com/ddrown/teensy_ir_to_keyboard/blob/master/ir_to_keyboard.ino

And my changes to the $ARDUINO_HOME/hardware/teensy/cores/usb_hid directory:

https://github.com/ddrown/teensy_usb_android

PaulStoffregen
01-21-2013, 01:29 PM
Have you tested sending these codes to a Windows machine?

http://msdn.microsoft.com/en-us/windows/hardware/gg463446

ddrown
01-21-2013, 03:47 PM
When sending to a windows machine, the bit-mapped keys above 0xFF (Search and Home in my case) work, but the bytecode ones (range 0x0-0xFF) do not work under windows (volume, play/pause/stop/ff/rev/skip)

It works under Android, however.