<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Toggle virtual keyboard with Bluetooth HID in iOS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73724/toggle-virtual-keyboard-with-bluetooth-hid-in-ios</link><description>Hi, 
 I am using ble_sdk_app_hids_keyboard example: 
 https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fble_sdk_app_hids_keyboard.html 
 and try to send toggle keyboard key to iOS without success. 
 the &amp;quot;Hello&amp;quot;</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 11 Apr 2021 15:52:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73724/toggle-virtual-keyboard-with-bluetooth-hid-in-ios" /><item><title>RE: Toggle virtual keyboard with Bluetooth HID in iOS</title><link>https://devzone.nordicsemi.com/thread/304146?ContentTypeID=1</link><pubDate>Sun, 11 Apr 2021 15:52:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a46eeec-61b8-4ff8-ae55-2e49fbbe6732</guid><dc:creator>Yair.P</dc:creator><description>&lt;p&gt;I succeeded to toggle keyboard on iphone.&lt;/p&gt;
&lt;p&gt;this is the fixed code:&lt;/p&gt;
&lt;p&gt;static void hids_init(void)&lt;br /&gt;{&lt;br /&gt; ret_code_t err_code;&lt;br /&gt; ble_hids_init_t hids_init_obj;&lt;br /&gt; ble_hids_inp_rep_init_t * p_input_report;&lt;br /&gt; ble_hids_outp_rep_init_t * p_output_report;&lt;br /&gt; ble_hids_feature_rep_init_t * p_feature_report;&lt;br /&gt; uint8_t hid_info_flags;&lt;/p&gt;
&lt;p&gt;static ble_hids_inp_rep_init_t input_report_array[2];&lt;br /&gt; static ble_hids_outp_rep_init_t output_report_array[1];&lt;br /&gt; static ble_hids_feature_rep_init_t feature_report_array[1];&lt;br /&gt; static uint8_t report_map_data[] =&lt;br /&gt; {&lt;br /&gt; 0x05, 0x01, // Usage Page (Generic Desktop)&lt;br /&gt; 0x09, 0x06, // Usage (Keyboard)&lt;br /&gt; 0xA1, 0x01, // Collection (Application)&lt;br /&gt; 0x85, 0x00, // Report Id (0)&lt;br /&gt; 0x05, 0x07, // Usage Page (Key Codes)&lt;br /&gt; 0x19, 0xe0, // Usage Minimum (224)&lt;br /&gt; 0x29, 0xe7, // Usage Maximum (231)&lt;br /&gt; 0x15, 0x00, // Logical Minimum (0)&lt;br /&gt; 0x25, 0x01, // Logical Maximum (1)&lt;br /&gt; 0x75, 0x01, // Report Size (1)&lt;br /&gt; 0x95, 0x08, // Report Count (8)&lt;br /&gt; 0x81, 0x02, // Input (Data, Variable, Absolute)&lt;/p&gt;
&lt;p&gt;0x95, 0x01, // Report Count (1)&lt;br /&gt; 0x75, 0x08, // Report Size (8)&lt;br /&gt; 0x81, 0x01, // Input (Constant) reserved byte(1)&lt;/p&gt;
&lt;p&gt;0x95, 0x05, // Report Count (5)&lt;br /&gt; 0x75, 0x01, // Report Size (1)&lt;br /&gt; 0x05, 0x08, // Usage Page (Page# for LEDs)&lt;br /&gt; 0x19, 0x01, // Usage Minimum (1)&lt;br /&gt; 0x29, 0x05, // Usage Maximum (5)&lt;br /&gt; 0x91, 0x02, // Output (Data, Variable, Absolute), Led report&lt;br /&gt; 0x95, 0x01, // Report Count (1)&lt;br /&gt; 0x75, 0x03, // Report Size (3)&lt;br /&gt; 0x91, 0x01, // Output (Data, Variable, Absolute), Led report padding&lt;/p&gt;
&lt;p&gt;0x95, 0x06, // Report Count (6)&lt;br /&gt; 0x75, 0x08, // Report Size (8)&lt;br /&gt; 0x15, 0x00, // Logical Minimum (0)&lt;br /&gt; 0x25, 0x65, // Logical Maximum (101)&lt;br /&gt; 0x05, 0x07, // Usage Page (Key codes)&lt;br /&gt; 0x19, 0x00, // Usage Minimum (0)&lt;br /&gt; 0x29, 0x65, // Usage Maximum (101)&lt;br /&gt; 0x81, 0x00, // Input (Data, Array) Key array(6 bytes)&lt;/p&gt;
&lt;p&gt;0x09, 0x05, // Usage (Vendor Defined)&lt;br /&gt; 0x15, 0x00, // Logical Minimum (0)&lt;br /&gt; 0x26, 0xFF, 0x00, // Logical Maximum (255)&lt;br /&gt; 0x75, 0x08, // Report Count (2)&lt;br /&gt; 0x95, 0x02, // Report Size (8 bit)&lt;br /&gt; 0xB1, 0x02, // Feature (Data, Variable, Absolute)&lt;/p&gt;
&lt;p&gt;0xC0, // End Collection (Application)&lt;br /&gt; // Report ID 2: Advanced buttons&lt;br /&gt; 0x05, 0x0C, // Usage Page (Consumer)&lt;br /&gt; 0x09, 0x01, // Usage (Consumer Control)&lt;br /&gt; 0xA1, 0x01, // Collection (Application)&lt;br /&gt; 0x85, 0x01, // Report Id (1)&lt;br /&gt; 0x15, 0x00, // Logical minimum (0)&lt;br /&gt; 0x25, 0x01, // Logical maximum (1)&lt;br /&gt; 0x75, 0x01, // Report Size (1)&lt;br /&gt; 0x95, 0x01, // Report Count (1)&lt;/p&gt;
&lt;p&gt;0x0A, 0xAE, 0x01, // Usage (AL Keyboard Layout)&lt;br /&gt; 0x81, 0x06, // Input (Data,Value,Relative,Bit Field)&lt;br /&gt; 0xC0 // End Collection&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;memset((void *)input_report_array, 0, sizeof(ble_hids_inp_rep_init_t));&lt;br /&gt; memset((void *)output_report_array, 0, sizeof(ble_hids_outp_rep_init_t));&lt;br /&gt; memset((void *)feature_report_array, 0, sizeof(ble_hids_feature_rep_init_t));&lt;/p&gt;
&lt;p&gt;// Initialize HID Service&lt;br /&gt; p_input_report = &amp;amp;input_report_array[INPUT_REPORT_KEYS_INDEX];&lt;br /&gt; p_input_report-&amp;gt;max_len = INPUT_REPORT_KEYS_MAX_LEN;&lt;br /&gt; p_input_report-&amp;gt;rep_ref.report_id = INPUT_REP_REF_ID;&lt;br /&gt; p_input_report-&amp;gt;rep_ref.report_type = BLE_HIDS_REP_TYPE_INPUT;&lt;/p&gt;
&lt;p&gt;p_input_report-&amp;gt;sec.cccd_wr = SEC_JUST_WORKS;&lt;br /&gt; p_input_report-&amp;gt;sec.wr = SEC_JUST_WORKS;&lt;br /&gt; p_input_report-&amp;gt;sec.rd = SEC_JUST_WORKS;&lt;/p&gt;
&lt;p&gt;// Initialize HID Service&lt;br /&gt; p_input_report = &amp;amp;input_report_array[1];&lt;br /&gt; p_input_report-&amp;gt;max_len = INPUT_REPORT_KEYS_MAX_LEN;&lt;br /&gt; p_input_report-&amp;gt;rep_ref.report_id = 1;&lt;br /&gt; p_input_report-&amp;gt;rep_ref.report_type = BLE_HIDS_REP_TYPE_INPUT;&lt;/p&gt;
&lt;p&gt;p_input_report-&amp;gt;sec.cccd_wr = SEC_JUST_WORKS;&lt;br /&gt; p_input_report-&amp;gt;sec.wr = SEC_JUST_WORKS;&lt;br /&gt; p_input_report-&amp;gt;sec.rd = SEC_JUST_WORKS;&lt;br /&gt; p_input_report = &amp;amp;input_report_array[INPUT_REPORT_KEYS_INDEX];&lt;/p&gt;
&lt;p&gt;p_output_report = &amp;amp;output_report_array[OUTPUT_REPORT_INDEX];&lt;br /&gt; p_output_report-&amp;gt;max_len = OUTPUT_REPORT_MAX_LEN;&lt;br /&gt; p_output_report-&amp;gt;rep_ref.report_id = OUTPUT_REP_REF_ID;&lt;br /&gt; p_output_report-&amp;gt;rep_ref.report_type = BLE_HIDS_REP_TYPE_OUTPUT;&lt;/p&gt;
&lt;p&gt;p_output_report-&amp;gt;sec.wr = SEC_JUST_WORKS;&lt;br /&gt; p_output_report-&amp;gt;sec.rd = SEC_JUST_WORKS;&lt;/p&gt;
&lt;p&gt;p_feature_report = &amp;amp;feature_report_array[FEATURE_REPORT_INDEX];&lt;br /&gt; p_feature_report-&amp;gt;max_len = FEATURE_REPORT_MAX_LEN;&lt;br /&gt; p_feature_report-&amp;gt;rep_ref.report_id = FEATURE_REP_REF_ID;&lt;br /&gt; p_feature_report-&amp;gt;rep_ref.report_type = BLE_HIDS_REP_TYPE_FEATURE;&lt;/p&gt;
&lt;p&gt;p_feature_report-&amp;gt;sec.rd = SEC_JUST_WORKS;&lt;br /&gt; p_feature_report-&amp;gt;sec.wr = SEC_JUST_WORKS;&lt;/p&gt;
&lt;p&gt;hid_info_flags = HID_INFO_FLAG_REMOTE_WAKE_MSK | HID_INFO_FLAG_NORMALLY_CONNECTABLE_MSK;&lt;/p&gt;
&lt;p&gt;memset(&amp;amp;hids_init_obj, 0, sizeof(hids_init_obj));&lt;/p&gt;
&lt;p&gt;hids_init_obj.evt_handler = on_hids_evt;&lt;br /&gt; hids_init_obj.error_handler = service_error_handler;&lt;br /&gt; hids_init_obj.is_kb = true;&lt;br /&gt; hids_init_obj.is_mouse = false;&lt;br /&gt; hids_init_obj.inp_rep_count = 2;&lt;br /&gt; hids_init_obj.p_inp_rep_array = input_report_array;&lt;br /&gt; hids_init_obj.outp_rep_count = 1;&lt;br /&gt; hids_init_obj.p_outp_rep_array = output_report_array;&lt;br /&gt; hids_init_obj.feature_rep_count = 1;&lt;br /&gt; hids_init_obj.p_feature_rep_array = feature_report_array;&lt;br /&gt; hids_init_obj.rep_map.data_len = sizeof(report_map_data);&lt;br /&gt; hids_init_obj.rep_map.p_data = report_map_data;&lt;br /&gt; hids_init_obj.hid_information.bcd_hid = BASE_USB_HID_SPEC_VERSION;&lt;br /&gt; hids_init_obj.hid_information.b_country_code = 0;&lt;br /&gt; hids_init_obj.hid_information.flags = hid_info_flags;&lt;br /&gt; hids_init_obj.included_services_count = 0;&lt;br /&gt; hids_init_obj.p_included_services_array = NULL;&lt;/p&gt;
&lt;p&gt;hids_init_obj.rep_map.rd_sec = SEC_JUST_WORKS;&lt;br /&gt; hids_init_obj.hid_information.rd_sec = SEC_JUST_WORKS;&lt;/p&gt;
&lt;p&gt;hids_init_obj.boot_kb_inp_rep_sec.cccd_wr = SEC_JUST_WORKS;&lt;br /&gt; hids_init_obj.boot_kb_inp_rep_sec.rd = SEC_JUST_WORKS;&lt;/p&gt;
&lt;p&gt;hids_init_obj.boot_kb_outp_rep_sec.rd = SEC_JUST_WORKS;&lt;br /&gt; hids_init_obj.boot_kb_outp_rep_sec.wr = SEC_JUST_WORKS;&lt;/p&gt;
&lt;p&gt;hids_init_obj.protocol_mode_rd_sec = SEC_JUST_WORKS;&lt;br /&gt; hids_init_obj.protocol_mode_wr_sec = SEC_JUST_WORKS;&lt;br /&gt; hids_init_obj.ctrl_point_wr_sec = SEC_JUST_WORKS;&lt;/p&gt;
&lt;p&gt;err_code = ble_hids_init(&amp;amp;m_hids, &amp;amp;hids_init_obj);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and for toggle:&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;uint32_t err_code;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; static uint8_t keyboard_toggle[] = {1};&lt;br /&gt; //static uint8_t keyboard_toggle[] = {0x01};&lt;br /&gt; //// 1 designates the report index, not report ID. &lt;br /&gt; err_code = ble_hids_inp_rep_send(&amp;amp;m_hids, 1, sizeof(keyboard_toggle), keyboard_toggle, m_conn_handle);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; uint8_t release[] = {0};&lt;br /&gt; ble_hids_inp_rep_send(&amp;amp;m_hids, 1, sizeof(release), release, m_conn_handle);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Toggle virtual keyboard with Bluetooth HID in iOS</title><link>https://devzone.nordicsemi.com/thread/303924?ContentTypeID=1</link><pubDate>Fri, 09 Apr 2021 08:56:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f33ec0ac-46b8-47c7-8439-cf9713ad7fb5</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Hi Yair,&lt;br /&gt;&lt;br /&gt;Tried looking in to this and seems like tis might be a apple issue, we have a post&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/59808/sending-ble-hid-command-to-open-the-context-menu-descriptor-configuration"&gt;here&lt;/a&gt;&amp;nbsp;from a year ago and not sure if there is a solution. There is also &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/36647/how-to-coexist-virtual-and-physical-keyboard/145031#145031"&gt;this post&lt;/a&gt; that is also linked. And I check the apple developer forums&amp;nbsp;&lt;a href="https://developer.apple.com/forums/thread/131346"&gt;Toggle virtual keyboard with Bluet… | Apple Developer Forums&lt;/a&gt;&amp;nbsp;but there seems to be no solution at the moment. Sorry i cant be of more help bout i would advice to contact apple support at ask how to solve the issue. And if you find one feel free to update this post with a how to solve.&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Toggle virtual keyboard with Bluetooth HID in iOS</title><link>https://devzone.nordicsemi.com/thread/303671?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2021 08:28:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:451866a1-8685-4836-8c9e-ef69ae59ca8d</guid><dc:creator>Yair.P</dc:creator><description>&lt;p&gt;yes. all working fine except toggling key in iOS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Toggle virtual keyboard with Bluetooth HID in iOS</title><link>https://devzone.nordicsemi.com/thread/303668?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2021 08:18:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed1475af-5043-4cff-8e1f-31947c39b2b9</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Is the rest of the example working?&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/8535._5F00_Insert-Code-_2D00_-Nordic-2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>