Alienware AW410K support

This commit is contained in:
Dominik Mikołajczyk 2023-10-23 08:58:36 +02:00 committed by Adam Honse
parent 5cb0e54443
commit 8bf0ab45a1
6 changed files with 1141 additions and 1 deletions

View file

@ -1,7 +1,9 @@
#include "Detector.h"
#include "AlienwareAW510KController.h"
#include "AlienwareAW410KController.h"
#include "RGBController.h"
#include "RGBController_AlienwareAW510K.h"
#include "RGBController_AlienwareAW410K.h"
#include <hidapi/hidapi.h>
/*-----------------------------------------------------*\
@ -13,6 +15,7 @@
| Keyboard product IDs |
\*-----------------------------------------------------*/
#define ALIENWARE_AW510K_PID 0x1830
#define ALIENWARE_AW410K_PID 0x1968
/******************************************************************************************\
* *
@ -32,7 +35,20 @@ void DetectAlienwareAW510KControllers(hid_device_info* info, const std::string&
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
} /* DetectAlienwareKeyboardControllers() */
}
void DetectAlienwareAW410KControllers(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
if( dev )
{
AlienwareAW410KController* controller = new AlienwareAW410KController(dev, info->path);
RGBController_AlienwareAW410K* rgb_controller = new RGBController_AlienwareAW410K(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}/* DetectAlienwareKeyboardControllers() */
REGISTER_HID_DETECTOR_IPU("Alienware AW510K", DetectAlienwareAW510KControllers, ALIENWARE_VID, ALIENWARE_AW510K_PID, 0x02, 0xFF00, 0x01);
REGISTER_HID_DETECTOR_IPU("Alienware AW410K", DetectAlienwareAW410KControllers, ALIENWARE_VID, ALIENWARE_AW410K_PID, 0x02, 0xFF00, 0x01);