mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-22 05:57:53 -05:00
Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions
This commit is contained in:
@@ -14,18 +14,23 @@
|
||||
#include "DetectionManager.h"
|
||||
#include "RGBController_ValkyrieKeyboard.h"
|
||||
|
||||
void DetectValkyrieKeyboardControllers(hid_device_info* info, const std::string& name)
|
||||
DetectedControllers DetectValkyrieKeyboardControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
ValkyrieKeyboardController* controller = new ValkyrieKeyboardController(dev, info->path, info->product_id, info->interface_number, name);
|
||||
RGBController_ValkyrieKeyboard* rgb_controller = new RGBController_ValkyrieKeyboard(controller);
|
||||
DetectionManager::get()->RegisterRGBController(rgb_controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
/* DetectValkyrieKeyboardControllers() */
|
||||
REGISTER_HID_DETECTOR_IPU("Valkyrie VK99 Pro", DetectValkyrieKeyboardControllers, VALKYRIE_VID, VALKYRIE_99_PRO_PID, 3, 0xFF13, 0x0001);
|
||||
REGISTER_HID_DETECTOR_IPU("Valkyrie VK99", DetectValkyrieKeyboardControllers, VALKYRIE_VID, VALKYRIE_99_NORMAL_PID, 2, 0xFF13, 0x0001);
|
||||
|
||||
Reference in New Issue
Block a user