Use HID path for Location on HyperX Keyboard controller
This commit is contained in:
parent
158aac5ee4
commit
d6350c8504
4 changed files with 14 additions and 4 deletions
|
|
@ -27,9 +27,10 @@ static unsigned int extended_red[] = {0x08, 0x48, 0x88, 0x09, 0x89, 0x0A, 0x8A,
|
|||
static unsigned int extended_grn[] = {0x29, 0x28, 0x78, 0x19, 0x79, 0x1A, 0x7A, 0x1B, 0x7B, 0x1C, 0x7C, 0x1D, 0x7D, 0x1E, 0x6E, 0x7E, 0x1F, 0x6F, 0x82, 0x23, 0x83, 0x22 };
|
||||
static unsigned int extended_blu[] = {0x39, 0x38, 0x68, 0x3A, 0x69, 0x2A, 0x6A, 0x2B, 0x6B, 0x2C, 0x6C, 0x2D, 0x6D, 0x2E, 0x5E, 0x5D, 0x2F, 0x5F, 0x72, 0x33, 0x73, 0x32 };
|
||||
|
||||
HyperXKeyboardController::HyperXKeyboardController(hid_device* dev_handle)
|
||||
HyperXKeyboardController::HyperXKeyboardController(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
}
|
||||
|
||||
HyperXKeyboardController::~HyperXKeyboardController()
|
||||
|
|
@ -37,6 +38,11 @@ HyperXKeyboardController::~HyperXKeyboardController()
|
|||
|
||||
}
|
||||
|
||||
std::string HyperXKeyboardController::GetDeviceLocation()
|
||||
{
|
||||
return(location);
|
||||
}
|
||||
|
||||
void HyperXKeyboardController::SetMode
|
||||
(
|
||||
unsigned char mode,
|
||||
|
|
|
|||
|
|
@ -65,9 +65,11 @@ enum
|
|||
class HyperXKeyboardController
|
||||
{
|
||||
public:
|
||||
HyperXKeyboardController(hid_device* dev_handle);
|
||||
HyperXKeyboardController(hid_device* dev_handle, const char* path);
|
||||
~HyperXKeyboardController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
|
||||
void SetMode
|
||||
(
|
||||
unsigned char mode,
|
||||
|
|
@ -84,6 +86,7 @@ private:
|
|||
unsigned char active_mode;
|
||||
unsigned char active_direction;
|
||||
unsigned char active_speed;
|
||||
std::string location;
|
||||
|
||||
void SelectProfile
|
||||
(
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ void DetectHyperXKeyboardControllers(std::vector<RGBController*>& rgb_controller
|
|||
|
||||
if( dev )
|
||||
{
|
||||
HyperXKeyboardController* controller = new HyperXKeyboardController(dev);
|
||||
HyperXKeyboardController* controller = new HyperXKeyboardController(dev, info->path);
|
||||
|
||||
RGBController_HyperXKeyboard* rgb_controller = new RGBController_HyperXKeyboard(controller);
|
||||
|
||||
|
|
|
|||
|
|
@ -182,6 +182,7 @@ RGBController_HyperXKeyboard::RGBController_HyperXKeyboard(HyperXKeyboardControl
|
|||
name = "HyperX RGB Keyboard";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "HyperX RGB Keyboard Device";
|
||||
location = hyperx->GetDeviceLocation();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue