<?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>Click in HID mouse example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9854/click-in-hid-mouse-example</link><description>Dear Nordic Team, 
 I am using HID mouse example code in my nordic dk board. 
 I can able implemented fallowing logic in my code to do left , right and middle button click. 
 static void mouse_click_send(uint8_t x, uint8_t y, uint8_t z)
{
uint32_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 26 Oct 2015 09:03:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9854/click-in-hid-mouse-example" /><item><title>RE: Click in HID mouse example</title><link>https://devzone.nordicsemi.com/thread/36575?ContentTypeID=1</link><pubDate>Mon, 26 Oct 2015 09:03:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19383658-506d-4932-a00d-e3c27c092bf7</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi SamV,&lt;/p&gt;
&lt;p&gt;I found one bug with the code you provide. uint8_t * buffer; is not initialized before you use it. You should assign it to an array or do malloc.
If you change the code to:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void mouse_click_send(uint8_t x, uint8_t y, uint8_t z) 
	{ 
		uint32_t err_code; uint8_t buffer[3]; 
		if (m_in_boot_mode) return; 

    buffer[0] = x; // Left button (bit 0) pressed
		buffer[1] = y; // Scroll value (-127, 128)
		buffer[2] = z; // Sideways scroll value (-127, 128)

		err_code = ble_hids_inp_rep_send(&amp;amp;m_hids,INPUT_REP_BUTTONS_INDEX, INPUT_REP_BUTTONS_LEN, buffer);
		if ((err_code != NRF_SUCCESS) &amp;amp;&amp;amp;
				(err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp;
				(err_code != BLE_ERROR_NO_TX_BUFFERS) &amp;amp;&amp;amp;
				(err_code != BLE_ERROR_GATTS_SYS_ATTR_MISSING)
			)
		{
				APP_ERROR_CHECK(err_code);
		}
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It should work.&lt;/p&gt;
&lt;p&gt;To make a left click you call mouse_click_send(1,0,0); don&amp;#39;t forget to release the key press by calling:
mouse_click_send(0,0,0);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Click in HID mouse example</title><link>https://devzone.nordicsemi.com/thread/36574?ContentTypeID=1</link><pubDate>Fri, 23 Oct 2015 13:33:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac19a2d8-3e2a-4a6b-aa4e-d42a59076200</guid><dc:creator>SamV</dc:creator><description>&lt;p&gt;I am confused, i went through that documents but not able to understand fully.&lt;/p&gt;
&lt;p&gt;i just want to do click in my android by using existing ble hid mouse example.&lt;/p&gt;
&lt;p&gt;kindly let me know how to do?.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Click in HID mouse example</title><link>https://devzone.nordicsemi.com/thread/36573?ContentTypeID=1</link><pubDate>Fri, 23 Oct 2015 11:37:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1438e96-a9cb-456b-937f-d8a2e790ff32</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Sam,
If you want to know how to handle mouse in Android you may have to look into this &lt;a href="http://developer.android.com/reference/android/view/InputDevice.html"&gt;documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A left mouse click in Android is pretty much the same as a touch on the screen.&lt;/p&gt;
&lt;p&gt;Regarding HID report and how to understand, I found a good tutorial &lt;a href="http://eleccelerator.com/tutorial-about-usb-hid-report-descriptors/"&gt;here&lt;/a&gt;. In that page you will find the link to the HID1_11.pdf spec defined by USB.org.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s also explained by the answer from Jon Helge in the case I cited above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Click in HID mouse example</title><link>https://devzone.nordicsemi.com/thread/36572?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2015 17:35:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f2e18d6-f511-41e6-b2ed-13275e786015</guid><dc:creator>SamV</dc:creator><description>&lt;p&gt;Yes , i checked that case , could you please let me know , how can i handle click in android.&lt;/p&gt;
&lt;p&gt;or what is data need to send for click in android.&lt;/p&gt;
&lt;p&gt;Or i also want to develop hid mouse application as absolute mouse ?.&lt;/p&gt;
&lt;p&gt;Could you please tell me how to understand the report map data and characteristic?.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Click in HID mouse example</title><link>https://devzone.nordicsemi.com/thread/36571?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2015 10:32:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aecf53b2-104f-482a-aa9a-80c23888d56b</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Sam,&lt;/p&gt;
&lt;p&gt;Have you looked at &lt;a href="https://devzone.nordicsemi.com/question/41913/what-can-i-do-if-i-want-to-send-left-or-right-button-data/"&gt;this case&lt;/a&gt; ?&lt;/p&gt;
&lt;p&gt;If you send mouse_click_send(1,0,0);  would it act as a click in Android ?&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think Android main screen would handle right click, maybe in your app you can handle that, but I&amp;#39;m not 100% sure.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>