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

Sending multiple characters using single keystroke in HID keyboard example

Hi experts I am trying to play a little with BLE HID keyboard example supplied by nordic I see that there is an array of 5 characters "hello" + "enterkey press" which is sent when button 1 is pressed. On every key press first "h" is sent then "e" then "l" .... and so on . Last character being sent is enterkey press. Now i was wondering will it be possible to send complete word "hello+ enterkeypress" in single button press of button 1. if yes can you guide me as to what are the necessary changes in source code i have to make.

SDK being used is 12.2.0 Softdevice S130 Board nRF51-dk nrf51422

Parents
  • Dear Sigurd,

    I think your answer is partially wrong.

    Yes, an input report accepts up to 6 characters, but one needs to understand that this is supposed to be 6 characters which were pressed in continuous order, equal to 6 x key-press actions. HID keyboard stuff is different from older MFC/PS2 keyboard handling.

    In order to send a "character string" the software needs to send an input report for each key, followed by the release of this key.

    Sending "hello" with keys_send() would mean this on a real keyboard : you press and hold the keys h, e, l, l, o - then release h, e, l, l, o - which is of course not a valid way of typing.

    matthias

Reply
  • Dear Sigurd,

    I think your answer is partially wrong.

    Yes, an input report accepts up to 6 characters, but one needs to understand that this is supposed to be 6 characters which were pressed in continuous order, equal to 6 x key-press actions. HID keyboard stuff is different from older MFC/PS2 keyboard handling.

    In order to send a "character string" the software needs to send an input report for each key, followed by the release of this key.

    Sending "hello" with keys_send() would mean this on a real keyboard : you press and hold the keys h, e, l, l, o - then release h, e, l, l, o - which is of course not a valid way of typing.

    matthias

Children
No Data
Related