This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Key release data packet issue in ble_app_hids_keyboard

Application: ble_app_hids_keyboard

SDK version: 17.0.2

SoC: nRF52832

The data packet for ‘H’ is monitored as

46 20 0F 00 0B 00 04 00 1B 18 00 02 00 0B 00 00 00 00 00 .

The data packet for key release is monitored as

46 20 0F 00 0B 00 04 00 1B 18 00 02 00 00 00 00 00 00 00 .

 

This data packet for key release is very dangerous and forces my PC (Windows 10) to the key-shifted state.  

 

The data packet for key release should be

46 20 0F 00 0B 00 04 00 1B 18 00 00 00 00 00 00 00 00 00 .

 

How can I modify ble_app_hids_keyboard to get the correct data packet for key release?

yts

Parents
  • I find the solution

    In send_key_scan_press_release function:

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

            if(offset == data_len) data[MODIFIER_KEY_POS] = 0;//<----------- add this statement

            if (!m_in_boot_mode)

    yts

Reply
  • I find the solution

    In send_key_scan_press_release function:

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

            if(offset == data_len) data[MODIFIER_KEY_POS] = 0;//<----------- add this statement

            if (!m_in_boot_mode)

    yts

Children
Related