mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-26 07:58:16 -05:00
Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions
This commit is contained in:
@@ -7,46 +7,58 @@
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "CougarKeyboardController.h"
|
||||
#include "CougarRevengerSTController.h"
|
||||
#include "DetectionManager.h"
|
||||
#include "RGBController_CougarKeyboard.h"
|
||||
#include "RGBController_CougarRevengerST.h"
|
||||
|
||||
/*----------------------------------------------------------*\
|
||||
| Cougar vendor ID |
|
||||
\*----------------------------------------------------------*/
|
||||
/*---------------------------------------------------------*\
|
||||
| Cougar vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define COUGAR_VID 0x12CF
|
||||
#define COUGAR_VID_2 0x060B
|
||||
|
||||
/*----------------------------------------------------------*\
|
||||
| Product ID |
|
||||
\*----------------------------------------------------------*/
|
||||
/*---------------------------------------------------------*\
|
||||
| Product ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define COUGAR_700K_EVO_PID 0x7010
|
||||
#define COUGAR_REVENGER_ST_PID 0x0412
|
||||
|
||||
void DetectCougarRevengerSTControllers(hid_device_info* info, const std::string& name)
|
||||
DetectedControllers DetectCougarRevengerSTControllers(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)
|
||||
{
|
||||
CougarRevengerSTController* controller = new CougarRevengerSTController(dev, *info, name);
|
||||
RGBController_CougarRevengerST* rgb_controller = new RGBController_CougarRevengerST(controller);
|
||||
|
||||
DetectionManager::get()->RegisterRGBController(rgb_controller);
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
void DetectCougar700kEvo(hid_device_info* info, const std::string& name)
|
||||
DetectedControllers DetectCougar700kEvo(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
if (dev)
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
CougarKeyboardController* controller = new CougarKeyboardController(dev, info->path, name);
|
||||
RGBController_CougarKeyboard* rgb_controller = new RGBController_CougarKeyboard(controller);
|
||||
|
||||
DetectionManager::get()->RegisterRGBController(rgb_controller);
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("Cougar 700K EVO Gaming Keyboard", DetectCougar700kEvo, COUGAR_VID_2, COUGAR_700K_EVO_PID, 3, 0xFF00, 1);
|
||||
|
||||
Reference in New Issue
Block a user