• Hi everybody / Gordon,

    thanks for Espruino/Puck/Pixl !!
    Right now I am on a project using Puck.js to interface a (at this point unconnected/unused) steering wheel remote control to an Android tablet.
    Generally, I read the wired remote control with the Puck and then send HID events to the Android tablet.
    What I need is the possibility to send multimedia controls and normal keyboard events during the same connection. Right now it seems to me I have to decide up front (before connecting the puck), which role I want. Is there a way around it and connect in both roles? Preliminary testing did not work for me unfortunately, but I am generally clueless on this ...

    Thanks for any hint,


  • I'm not 100% sure - you might be able to construct your own HID report (as at the top of http://www.espruino.com/modules/ble_hid_­keyboard.js ) that does both but I'm not sure how.

    However it might be that you can use a single type of device that does what you want.

    So currently we have:

    But looking at https://source.android.com/devices/input­/keyboard-devices#hid-keyboard-and-keypa­d-page-0x07 it seems that code page 0x07 does normal keyboard stuff and volume/pause/etc.

    And as far as I can tell, http://www.espruino.com/modules/ble_hid_­keyboard.js is already using code page 7 (if you look further down the HID report)

    Only gotcha is the Usage Maximum is 115 at the moment so I don't think you can send a key code larger than that. You could try adding the code from the module directly into your project, then modifying those Usage Maximum lines to 0xfb which seems to be the last key code defined, and then you could try sending key code 0xe8 (playpause) and see what happens?

    If that actually works I could just modify the HID report to always include that

  • Thanks for your suggestion! Could not try it for now due to time constraints, but hoping to do itin the coming days!
    Cheers, Joost

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Puck.js as HID Keyboard and Multimedia control simultaneously?

Posted by Avatar for Joost @Joost