how to implement mouse click in nrf desktop

Hello,

I am looking at nrf desktop sample in ncs 2.4.2. I am using nrf52840dk and relevant files. My goal is to make composite usb/bt device mouse and keyboard work.

I see in src/hw_interface there is

-buttons_sim.c, which shows how to do keyboard keypresses.

-motion_buttons.c, which simulates mouse movement using buttons

1. Are my interpretations of these files correct?

2. Is there an example implementation where a mouse click is shown?

If not, could you give a small example for how to do this? The example I'm looking for should be end in APP_EVENT_SUBMIT()

An explanatory explanation of how to do it could also suffice.

Eg. for mouse movement, it is very simple

void mouse_movement_send(int8_t x, int8_t y)
{
    struct motion_event *event = new_motion_event();
    event->dx = x;
    event->dy = y;
    APP_EVENT_SUBMIT(event);
}

Thank you!
Parents Reply Children
No Data
Related