Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions

This commit is contained in:
Adam Honse
2026-01-12 19:05:21 -06:00
parent 1ccaadd5d0
commit 9bb2a4e693
197 changed files with 4481 additions and 4332 deletions

View File

@@ -17,27 +17,22 @@
#define MSI_3_ZONE_KEYBOARD_VID 0x1770
#define MSI_3_ZONE_KEYBOARD_PID 0xFF00
/******************************************************************************************\
* *
* DetectMSI3ZoneControllers *
* *
* Tests the USB address to see if an MSI/SteelSeries 3-zone Keyboard controller *
* exists there. *
* *
\******************************************************************************************/
void DetectMSI3ZoneControllers(hid_device_info* info, const std::string&)
DetectedControllers DetectMSI3ZoneControllers(hid_device_info* info, const std::string&)
{
hid_device* dev = hid_open_path(info->path);
DetectedControllers detected_controllers;
hid_device* dev;
dev = hid_open_path(info->path);
if(dev)
{
MSI3ZoneController* controller = new MSI3ZoneController(dev, info->path);
RGBController_MSI3Zone* rgb_controller = new RGBController_MSI3Zone(controller);
// Constructor sets the name
DetectionManager::get()->RegisterRGBController(rgb_controller);
detected_controllers.push_back(rgb_controller);
}
} /* DetectMSI3ZoneControllers() */
return(detected_controllers);
}
REGISTER_HID_DETECTOR("MSI 3-Zone Laptop", DetectMSI3ZoneControllers, MSI_3_ZONE_KEYBOARD_VID, MSI_3_ZONE_KEYBOARD_PID);