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

Click in HID mouse example

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 err_code; uint8_t * buffer; 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(&m_hids,INPUT_REP_BUTTONS_INDEX, INPUT_REP_BUTTONS_LEN, buffer);
if ((err_code != NRF_SUCCESS) &&
    (err_code != NRF_ERROR_INVALID_STATE) &&
    (err_code != BLE_ERROR_NO_TX_BUFFERS) &&
    (err_code != BLE_ERROR_GATTS_SYS_ATTR_MISSING)
)
{
    APP_ERROR_CHECK(err_code);
}

}

mouse_click_send(1,0,0); // this is changing the screen in my android. mouse_click_send(2,0,0); // Nothing happen mouse_click_send(3,0,0); // Nothing happen

Could you tell me what this function will do exactly in android?.

I also need to do click in my android , so that i can open application.

Could you tell me what is data format i need to send?.

Kindly tell me, your help will be greatly appreciable.

Regards SamV

Parents Reply Children
No Data
Related