Store name in HYTEKeyboardController to avoid setting it in detector
This commit is contained in:
parent
0269cdd068
commit
d412ef5e17
4 changed files with 21 additions and 14 deletions
|
|
@ -12,10 +12,11 @@
|
|||
#include <cstring>
|
||||
#include "HYTEKeyboardController.h"
|
||||
|
||||
HYTEKeyboardController::HYTEKeyboardController(hid_device* dev_handle, const char* path)
|
||||
HYTEKeyboardController::HYTEKeyboardController(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
}
|
||||
|
||||
HYTEKeyboardController::~HYTEKeyboardController()
|
||||
|
|
@ -28,6 +29,11 @@ std::string HYTEKeyboardController::GetDeviceLocation()
|
|||
return("HID " + location);
|
||||
}
|
||||
|
||||
std::string HYTEKeyboardController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
void HYTEKeyboardController::LEDStreaming(unsigned int zone, RGBColor* colors)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
|
|
|
|||
|
|
@ -24,16 +24,18 @@ enum
|
|||
class HYTEKeyboardController
|
||||
{
|
||||
public:
|
||||
HYTEKeyboardController(hid_device* dev_handle, const char* path);
|
||||
HYTEKeyboardController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
~HYTEKeyboardController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
|
||||
void LEDStreaming(unsigned int zone, RGBColor* colors);
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
|
||||
void LEDStreaming_Keyboard(RGBColor* colors);
|
||||
void LEDStreaming_Surround(RGBColor* colors);
|
||||
|
|
|
|||
|
|
@ -30,9 +30,8 @@ void DetectHYTEKeyboard(hid_device_info* info, const std::string& name)
|
|||
|
||||
if(dev)
|
||||
{
|
||||
HYTEKeyboardController* controller = new HYTEKeyboardController(dev, info->path);
|
||||
HYTEKeyboardController* controller = new HYTEKeyboardController(dev, info->path, name);
|
||||
RGBController_HYTEKeyboard* rgb_controller = new RGBController_HYTEKeyboard(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,19 +59,19 @@ keyboard_keymap_overlay_values hyte_keeb_tkl_layout =
|
|||
|
||||
RGBController_HYTEKeyboard::RGBController_HYTEKeyboard(HYTEKeyboardController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
controller = controller_ptr;
|
||||
|
||||
name = "HYTE Keyboard Device";
|
||||
vendor = "HYTE";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "HYTE Keyboard Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "HYTE";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "HYTE Keyboard Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0xFFFF;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0xFFFF;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
SetupZones();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue