USB Libraries Help > USB Host Libraries > USB HID Host Mouse Driver Library > Using the Library > How the Library Works > Detecting Device Attach
MPLAB Harmony USB Stack
Detecting Device Attach

The application will need to know when a HID mouse device is attached. To receive this attach event from the USB HID Host Mouse Driver, the application must register an Attach Event Handler by calling the USB_HOST_HID_MOUSE_EventHandlerSet function. This function should be called before calling the USB_HOST_BusEnable function; otherwise, the application may miss HID attach events.