Store name in RedSquareControllers to avoid setting it in detectors

This commit is contained in:
Adam Honse 2025-08-14 19:32:37 -05:00
parent 06413f2877
commit 9680d072fa
7 changed files with 35 additions and 21 deletions

View file

@ -55,16 +55,16 @@ layout_values keyrox_tkl_offset_values =
RGBController_RedSquareKeyroxTKLClassic::RGBController_RedSquareKeyroxTKLClassic(RedSquareKeyroxTKLClassicController* controller_ptr)
{
controller = controller_ptr;
controller = controller_ptr;
name = "Red Square Keyrox TKL Classic";
vendor = "Red Square";
type = DEVICE_TYPE_KEYBOARD;
description = name;
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
name = controller->GetNameString();
vendor = "Red Square";
type = DEVICE_TYPE_KEYBOARD;
description = "Red Square Keyrox TKL Classic Device";
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
int BASE_EFFECT_FLAGS = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
int BASE_EFFECT_FLAGS = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
const int EFFECTS_COUNT = 14;
keyrox_effect keyrox_effects[EFFECTS_COUNT] =

View file

@ -14,10 +14,11 @@
using namespace std::chrono_literals;
RedSquareKeyroxTKLClassicController::RedSquareKeyroxTKLClassicController(hid_device *dev_handle, const hid_device_info &info)
RedSquareKeyroxTKLClassicController::RedSquareKeyroxTKLClassicController(hid_device *dev_handle, const hid_device_info &info, std::string dev_name)
{
dev = dev_handle;
location = info.path;
name = dev_name;
}
RedSquareKeyroxTKLClassicController::~RedSquareKeyroxTKLClassicController()
@ -30,6 +31,11 @@ std::string RedSquareKeyroxTKLClassicController::GetDeviceLocation()
return("HID: " + location);
}
std::string RedSquareKeyroxTKLClassicController::GetNameString()
{
return(name);
}
std::string RedSquareKeyroxTKLClassicController::GetSerialString()
{
wchar_t serial_wchar[128];

View file

@ -54,10 +54,11 @@ enum
class RedSquareKeyroxTKLClassicController
{
public:
RedSquareKeyroxTKLClassicController(hid_device *dev_handle, const hid_device_info &info);
RedSquareKeyroxTKLClassicController(hid_device *dev_handle, const hid_device_info &info, std::string dev_name);
~RedSquareKeyroxTKLClassicController();
std::string GetDeviceLocation();
std::string GetNameString();
std::string GetSerialString();
int GetDirection(int direction);
@ -71,6 +72,7 @@ protected:
private:
std::string location;
std::string name;
std::string serial_number;
std::vector<unsigned int> led_sequence_positions;
};