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

How to Create an HID mouse application using nRF52DK board and few extra buttons?

Hi,

I have gone through the "ble_app_hids_mouse" example program. So far the program seems to work great, but how do we take control of the buttons since the function used only translates button press to mouse x-y translations. Please hep. Later i would try using a joystick to control the mouse movements and two buttons to control mouse left and right button functionality.

But before that i need to get through the basics first. Please help me get this stuff working.

Disappointed

  • Hi,

    This post here shows you how to add this functionality. 

    The function updated to SDK 15 looks like this:

    Here is the list of values:

    0x00 - No buttons pressed
    
    0x01 - Left button pressed
    
    0x02 - Right button pressed
    
    0x03 - Both left and right button pressed

    To make a left click you call mouse_click_send(1,0,0); don't forget to release the key press by calling: mouse_click_send(0,0,0);

    You can test this on with button 4 (BSP_KEY_3) in bsp_event_handler() function like this:

  • great, got the stuff working.

    Thanks Sigurd.

    Regards,

    Hari