mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-24 22:45:55 -04:00
Move HID detector calls to RunHIDDetector/RunHIDWrappedDetector functions and return controller list from detector functions
This commit is contained in:
@@ -14,22 +14,25 @@
|
||||
#include "FnaticStreakController.h"
|
||||
#include "RGBController_FnaticStreak.h"
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Fnatic keyboard vendor and product IDs |
|
||||
| Based on leddy project keyboard.rs |
|
||||
| VID: 0x2f0e |
|
||||
| PID: 0x0101 (Streak full) |
|
||||
| PID: 0x0102 (miniStreak) |
|
||||
| Interface: 1 |
|
||||
\*-----------------------------------------------------*/
|
||||
/*---------------------------------------------------------*\
|
||||
| Fnatic keyboard vendor and product IDs |
|
||||
| Based on leddy project keyboard.rs |
|
||||
| VID: 0x2f0e |
|
||||
| PID: 0x0101 (Streak full) |
|
||||
| PID: 0x0102 (miniStreak) |
|
||||
| Interface: 1 |
|
||||
\*---------------------------------------------------------*/
|
||||
#define FNATIC_VID 0x2F0E
|
||||
|
||||
#define FNATIC_STREAK_PID 0x0101
|
||||
#define FNATIC_MINISTREAK_PID 0x0102
|
||||
|
||||
void DetectFnaticStreakKeyboard(hid_device_info* info, const std::string& name)
|
||||
DetectedControllers DetectFnaticStreakKeyboard(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)
|
||||
{
|
||||
@@ -47,8 +50,10 @@ void DetectFnaticStreakKeyboard(hid_device_info* info, const std::string& name)
|
||||
FnaticStreakController* controller = new FnaticStreakController(dev, info, name, kb_type);
|
||||
RGBController_FnaticStreak* rgb_controller = new RGBController_FnaticStreak(controller);
|
||||
|
||||
DetectionManager::get()->RegisterRGBController(rgb_controller);
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_I("Fnatic Streak", DetectFnaticStreakKeyboard, FNATIC_VID, FNATIC_STREAK_PID, 1);
|
||||
|
||||
Reference in New Issue
Block a user