USB Libraries Help > USB Host Libraries > USB HID Host Mouse Driver Library > Library Interface > a) Mouse Access Functions > USB_HOST_HID_MOUSE_EventHandlerSet Function
MPLAB Harmony USB Stack
USB_HOST_HID_MOUSE_EventHandlerSet Function

This function registers application callback function with the mouse driver. Any subsequent mouse events is passed to the application by calling the registered application function. The function prototype should be of the USB_HOST_HID_MOUSE_EVENT_HANDLER type.

C
USB_HOST_HID_MOUSE_RESULT USB_HOST_HID_MOUSE_EventHandlerSet(
    USB_HOST_HID_MOUSE_EVENT_HANDLER appMouseEventHandler
);
Preconditions

This function should be called before the USB bus is enabled.

Parameters
Parameters 
Description 
appMouseEventHandler 
Function pointer to the application function. 
Returns

Returns data structure of USB_HOST_HID_MOUSE_RESULT type. USB_HOST_HID_MOUSE_RESULT_INVALID_PARAMETER: Invalid Parameter USB_HOST_HID_MOUSE_RESULT_FAILURE: On failure USB_HOST_HID_MOUSE_RESULT_SUCCESS: On success

Remarks

This function should be called before the USB bus is enabled.