Store name in WootingKeyboardController to avoid setting it in detector
This commit is contained in:
parent
550503d757
commit
d069947252
6 changed files with 19 additions and 19 deletions
|
|
@ -303,22 +303,22 @@ static const char *led_names_80HE[] =
|
||||||
|
|
||||||
RGBController_WootingKeyboard::RGBController_WootingKeyboard(WootingKeyboardController* controller_ptr)
|
RGBController_WootingKeyboard::RGBController_WootingKeyboard(WootingKeyboardController* controller_ptr)
|
||||||
{
|
{
|
||||||
controller = controller_ptr;
|
controller = controller_ptr;
|
||||||
|
|
||||||
LOG_DEBUG("%sAdding meta data", WOOTING_CONTROLLER_NAME);
|
LOG_DEBUG("%sAdding meta data", WOOTING_CONTROLLER_NAME);
|
||||||
name = controller->GetName();
|
name = controller->GetName();
|
||||||
vendor = controller->GetVendor();
|
vendor = controller->GetVendor();
|
||||||
type = DEVICE_TYPE_KEYBOARD;
|
type = DEVICE_TYPE_KEYBOARD;
|
||||||
description = controller->GetDescription();
|
description = controller->GetDescription();
|
||||||
location = controller->GetLocation();
|
location = controller->GetLocation();
|
||||||
serial = controller->GetSerial();
|
serial = controller->GetSerial();
|
||||||
|
|
||||||
LOG_DEBUG("%sAdding modes", WOOTING_CONTROLLER_NAME);
|
LOG_DEBUG("%sAdding modes", WOOTING_CONTROLLER_NAME);
|
||||||
mode Direct;
|
mode Direct;
|
||||||
Direct.name = "Direct";
|
Direct.name = "Direct";
|
||||||
Direct.value = 0xFFFF;
|
Direct.value = 0xFFFF;
|
||||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||||
modes.push_back(Direct);
|
modes.push_back(Direct);
|
||||||
|
|
||||||
SetupZones();
|
SetupZones();
|
||||||
|
|
|
||||||
|
|
@ -67,11 +67,10 @@ void DetectWootingOneKeyboardControllers(hid_device_info* info, const std::strin
|
||||||
uint8_t wooting_type = (info->product_id == WOOTING_ONE_OLD_PID) ? WOOTING_KB_TKL : WOOTING_KB_FULL;
|
uint8_t wooting_type = (info->product_id == WOOTING_ONE_OLD_PID) ? WOOTING_KB_TKL : WOOTING_KB_FULL;
|
||||||
|
|
||||||
LOG_DEBUG("[%s] Device type %i opened - creating Controller", controller_name, wooting_type);
|
LOG_DEBUG("[%s] Device type %i opened - creating Controller", controller_name, wooting_type);
|
||||||
WootingOneKeyboardController* controller = new WootingOneKeyboardController(dev, info->path, wooting_type);
|
WootingOneKeyboardController* controller = new WootingOneKeyboardController(dev, info->path, wooting_type, name);
|
||||||
|
|
||||||
LOG_DEBUG("[%s] Controller created - creating RGBController", controller_name);
|
LOG_DEBUG("[%s] Controller created - creating RGBController", controller_name);
|
||||||
RGBController_WootingKeyboard* rgb_controller = new RGBController_WootingKeyboard(controller);
|
RGBController_WootingKeyboard* rgb_controller = new RGBController_WootingKeyboard(controller);
|
||||||
rgb_controller->name = name;
|
|
||||||
|
|
||||||
LOG_DEBUG("[%s] Initialization complete - Registering controller\t%s", controller_name, name.c_str());
|
LOG_DEBUG("[%s] Initialization complete - Registering controller\t%s", controller_name, name.c_str());
|
||||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||||
|
|
@ -95,11 +94,10 @@ void DetectWootingTwoKeyboardControllers(hid_device_info* info, const std::strin
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_DEBUG("[%s] Device type %i opened - creating Controller", controller_name, wooting_type);
|
LOG_DEBUG("[%s] Device type %i opened - creating Controller", controller_name, wooting_type);
|
||||||
WootingTwoKeyboardController* controller = new WootingTwoKeyboardController(dev, info->path, wooting_type);
|
WootingTwoKeyboardController* controller = new WootingTwoKeyboardController(dev, info->path, wooting_type, name);
|
||||||
|
|
||||||
LOG_DEBUG("[%s] Controller created - creating RGBController", controller_name);
|
LOG_DEBUG("[%s] Controller created - creating RGBController", controller_name);
|
||||||
RGBController_WootingKeyboard* rgb_controller = new RGBController_WootingKeyboard(controller);
|
RGBController_WootingKeyboard* rgb_controller = new RGBController_WootingKeyboard(controller);
|
||||||
rgb_controller->name = name;
|
|
||||||
|
|
||||||
LOG_DEBUG("[%s] Initialization complete - Registering controller\t%s", controller_name, name.c_str());
|
LOG_DEBUG("[%s] Initialization complete - Registering controller\t%s", controller_name, name.c_str());
|
||||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||||
|
|
|
||||||
|
|
@ -53,10 +53,11 @@ static uint16_t getCrc16ccitt(const uint8_t* buffer, uint16_t size)
|
||||||
return crc;
|
return crc;
|
||||||
}
|
}
|
||||||
|
|
||||||
WootingOneKeyboardController::WootingOneKeyboardController(hid_device* dev_handle, const char *path, uint8_t wooting_type)
|
WootingOneKeyboardController::WootingOneKeyboardController(hid_device* dev_handle, const char *path, uint8_t wooting_type, std::string dev_name)
|
||||||
{
|
{
|
||||||
dev = dev_handle;
|
dev = dev_handle;
|
||||||
location = path;
|
location = path;
|
||||||
|
name = dev_name;
|
||||||
this->wooting_type = wooting_type;
|
this->wooting_type = wooting_type;
|
||||||
key_code_limit = (wooting_type == WOOTING_KB_TKL) ? WOOTING_ONE_KEY_CODE_LIMIT : WOOTING_TWO_KEY_CODE_LIMIT;
|
key_code_limit = (wooting_type == WOOTING_KB_TKL) ? WOOTING_ONE_KEY_CODE_LIMIT : WOOTING_TWO_KEY_CODE_LIMIT;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
class WootingOneKeyboardController : public WootingKeyboardController
|
class WootingOneKeyboardController : public WootingKeyboardController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WootingOneKeyboardController(hid_device* dev_handle, const char *path, uint8_t wooting_type);
|
WootingOneKeyboardController(hid_device* dev_handle, const char *path, uint8_t wooting_type, std::string dev_name);
|
||||||
~WootingOneKeyboardController();
|
~WootingOneKeyboardController();
|
||||||
|
|
||||||
void SendDirect(RGBColor* colors, uint8_t colour_count);
|
void SendDirect(RGBColor* colors, uint8_t colour_count);
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,11 @@ static unsigned int matrix_to_led_index_map_full[WOOTING_RGB_ROWS * WOOTING_TWO_
|
||||||
80, 101, NA, 18, 39, 60, 81, 102, 123, 19, 40, 61, 82, 103, 124, 20, 41, 62, NA, 104, NA
|
80, 101, NA, 18, 39, 60, 81, 102, 123, 19, 40, 61, 82, 103, 124, 20, 41, 62, NA, 104, NA
|
||||||
};
|
};
|
||||||
|
|
||||||
WootingTwoKeyboardController::WootingTwoKeyboardController(hid_device* dev_handle, const char *path, uint8_t wooting_type)
|
WootingTwoKeyboardController::WootingTwoKeyboardController(hid_device* dev_handle, const char *path, uint8_t wooting_type, std::string dev_name)
|
||||||
{
|
{
|
||||||
dev = dev_handle;
|
dev = dev_handle;
|
||||||
location = path;
|
location = path;
|
||||||
|
name = dev_name;
|
||||||
this->wooting_type = wooting_type;
|
this->wooting_type = wooting_type;
|
||||||
key_code_limit = (wooting_type == WOOTING_KB_TKL) ? WOOTING_ONE_KEY_CODE_LIMIT : WOOTING_TWO_KEY_CODE_LIMIT;
|
key_code_limit = (wooting_type == WOOTING_KB_TKL) ? WOOTING_ONE_KEY_CODE_LIMIT : WOOTING_TWO_KEY_CODE_LIMIT;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
class WootingTwoKeyboardController : public WootingKeyboardController
|
class WootingTwoKeyboardController : public WootingKeyboardController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WootingTwoKeyboardController(hid_device* dev_handle, const char *path, uint8_t wooting_type);
|
WootingTwoKeyboardController(hid_device* dev_handle, const char *path, uint8_t wooting_type, std::string dev_name);
|
||||||
~WootingTwoKeyboardController();
|
~WootingTwoKeyboardController();
|
||||||
|
|
||||||
void SendDirect(RGBColor* colors, uint8_t colour_count);
|
void SendDirect(RGBColor* colors, uint8_t colour_count);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue