problem with BLE_UART_HID using nRF52840

Hello,

I have interfaced the ble_hid_keyboard with uart  using nrf52840-Dk in SDK 17.1.0. I am getting data to BLE_HID over uart, but i am not getting uppercase letters when we send data over uart i am getting in lowercase. can you help me to get uppercase letter.

Parents
  • Hi 

    On keyboards there are no dedicated keycodes for upper case letters. Essentially you are sending the same key as for a lower case letter, and if the shift key or the caps lock key is set at the same time it will be interpreted as an uppercase letter by the host device. 

    If you look at the send_key_scan_press_release(..) function on line 824 of main.c you will see that it sets the shift key if you press one of the buttons on the DK, with this code:

    if (bsp_button_is_pressed(SHIFT_BUTTON_ID))
    {
      data[MODIFIER_KEY_POS] |= SHIFT_KEY_CODE;
    }

    You can do something similar every time you want to send uppercase characters. 

    Best regards
    Torbjørn

  • Hello..
    Thanks for the reply..
    Actually here I am trying to send the both upper and lower case letters sequentially over the UART. But when i am sending data I am getting all characters are in lower case. 

    If you look at the send_key_scan_press_release(..) function on line 824 of main.c you will see that it sets the shift key if you press one of the buttons on the DK, with this code:

    If I modify send_key_scan_release function i am getting only upper case letters. Here i need both upper case and lower case letters. Is there any configuration can be done to get both upper case and lower case letters.

  • Hi

    You can't send upper case and lower case letters in the same update, in the same way that you can't press upper case and lower case letters at the same time on the keyboard. 

    In this case you would need to send multiple packets, one for the lower case letters and one for the higher case letters. If you have a stream of mixed characters coming you would need to switch to a new packet every time the stream changes from lower case to upper case or vice versa. 

    Best regards
    Torbjørn

Reply
  • Hi

    You can't send upper case and lower case letters in the same update, in the same way that you can't press upper case and lower case letters at the same time on the keyboard. 

    In this case you would need to send multiple packets, one for the lower case letters and one for the higher case letters. If you have a stream of mixed characters coming you would need to switch to a new packet every time the stream changes from lower case to upper case or vice versa. 

    Best regards
    Torbjørn

Children
No Data
Related