• It looks to me like ble_hid_keyboard and ble_hid_controls might be mutually-exclusive. Is it feasible to send commands in both "mechanisms" without a rewrite of those modules?

    In the Adafruit Bluefruit LE services AT command API, I seem to remember it's possible to send both AT+BLEHIDCONTROLKEY and AT+BLEKEYBOARDCODE in the same "session" (so to speak). And, a typical Bluetooth keyboard with media keys can obviously do both media controls and keyboard presses simultaneously.

    I want to be able to send:

    • ble_hid_keyboard.KEY.RIGHT on single click;
    • ble_hid_keyboard.KEY.LEFT on double click;
    • and a control key (specifically control 0xb8 of the 0x0c Consumer Page, described on pg.77 of the HID Usage Tables PDF) on triple click.

    0xb8 is the "Show Keyboard / Eject" key, which should reveal the keyboard on iOS; if you connect even a one-button keyboard in iOS, it assumes you don't want the on-screen keyboard. I don't know of a way to tell iOS that it's a limited "auxiliary" keyboard, so without that, offering the Eject key is a workaround.

    I assume this is part of the HID report definition -- writing a comprehensive definition encompassing both -- but it's a bit beyond me. I'm wondering if @Gordon might know how to create a unified report definition capable of both, having written the two existing HID modules.

  • It should be possible, but I'm not quite sure how you'd do it - as you say it'll be down to getting the correct HID report sent out.

    Probably the easiest method would be to find something (like the Bluefruit device) that does it, and then see if you can find the HID report for it (you might be able to grab is via an app like nRF Connect)

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

ble_hid_keyboard and ble_hid_controls simultaneously?

Posted by Avatar for tom.gidden @tom.gidden