HID keyboard volume up down without consumer control?

Hi guys. May I ask some questions for ble_app_hids_keyboard_pca10056_s113 project from 17.1.0 nRF5 SDK:

From this thread,  HID keyboard with volume control with SDK 12

and a nRF Github example,

https://github.com/Rallare/nrf51_ble_app_hids_kbd_consumercontrol/blob/master/main.c

It sounded you cannot send volume up 0x80 or volume down 0x81 when only using the original ble_app_hids_keyboard_pca10056_s113 example.

Is this true that you always have to use the consumer control data to send volume up or down? Why won't keyboard 0x80 and 0x81 not work?

I'm testing this using iPhone 13 and Galaxy S22.

Parents
  • Hi,

     

    The descriptor is limited to the boot descriptor for a keyboard ("boot keyboard") as described in chapter 10 in the HID usage table:

    https://usb.org/sites/default/files/hut1_21.pdf

    And the consumer controls were added on top of this.

     

    It sounded you cannot send volume up 0x80 or volume down 0x81 when only using the original ble_app_hids_keyboard_pca10056_s113 example.

    With the stock example; you cannot send cmds greater than 0x65 (101).

    See the "Usage maximum" in the descriptor, which is set to 101 by default. You need to change the descriptor and test on your required platforms to see if it works as per your requirements.

     

    Kind regards,

    Håkon

  • Hello Håkon. Thanks to Sigurd, I changed that usage and logical maximum to 0xE7

     HID keyboard - how to send Windows GUI key 

    so that I can send Left and Right GUI / Windows key.

    EX: Sending left Windows key 0xE3

    Key press: 00 00 E3 00 00 00 00 00

    Release: 00 00 00 00 00 00 00 00

    This is working. Whereas sending Volume Up 0x80 is still not working

    Key press: 00 00 80 00 00 00 00 00

    Release: 00 00 00 00 00 00 00 00

    May I ask why this is happening? Is using the Consumer Control the only way?

  • Hi,

     

    I took the stock ble_app_hids_keyboard sample, adjusted the descriptor per the linked case.

    I changed the array "m_sample_key_press_scan_str" to send "test" + volume_up (0x80) + return.

    This will then be sent one byte on each button press.

     

    This adjusted the volume on both Ubuntu 22.04 and Android 13 (OnePlus 8)

     

    On which platform did this not work on your end?

     

    Kind regards,

    Håkon

  • Hello Håkon. Here are my test results, only Android took volume up down 80 81:

    Android / Samsung Galaxy S10 v12: the volume key 80 81 works

    Macbook / macOS 13.2.1: volume key doesn't work

    iPad air 5th Gen/ iPadOS v16.1.1: volume key doesn't work

    Windows 10 laptop with Intel Bluetooth driver (LMP 12 / Bluetooth v5.3): volume key doesn't work

    Is it only Android and Ubuntu that can take keyboard volume up down 0x80 81?

    I was creating this keyboard example for Windows and MacBook. In this case, is Consumer Control the only way to control volumes?

    Thank you for your help!

  • Hi,

     

    Matthew K said:

    Hello Håkon. Here are my test results, only Android took volume up down 80 81:

    Android / Samsung Galaxy S10 v12: the volume key 80 81 works

    Macbook / macOS 13.2.1: volume key doesn't work

    iPad air 5th Gen/ iPadOS v16.1.1: volume key doesn't work

    Windows 10 laptop with Intel Bluetooth driver (LMP 12 / Bluetooth v5.3): volume key doesn't work

    Is it only Android and Ubuntu that can take keyboard volume up down 0x80 81?

    I was creating this keyboard example for Windows and MacBook. In this case, is Consumer Control the only way to control volumes?

    It highly depends on what the OS on the other side accepts.

    If you have a solution that works on your target platforms, I would recommend that you keep using that. You can ask on windows/mac specific forums on how to handle those specific commands when connecting over HID over GATT.

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    Matthew K said:

    Hello Håkon. Here are my test results, only Android took volume up down 80 81:

    Android / Samsung Galaxy S10 v12: the volume key 80 81 works

    Macbook / macOS 13.2.1: volume key doesn't work

    iPad air 5th Gen/ iPadOS v16.1.1: volume key doesn't work

    Windows 10 laptop with Intel Bluetooth driver (LMP 12 / Bluetooth v5.3): volume key doesn't work

    Is it only Android and Ubuntu that can take keyboard volume up down 0x80 81?

    I was creating this keyboard example for Windows and MacBook. In this case, is Consumer Control the only way to control volumes?

    It highly depends on what the OS on the other side accepts.

    If you have a solution that works on your target platforms, I would recommend that you keep using that. You can ask on windows/mac specific forums on how to handle those specific commands when connecting over HID over GATT.

     

    Kind regards,

    Håkon

Children
No Data
Related