Use HID path for Location on SteelSeries Apex controller

This commit is contained in:
Adam Honse
2020-10-05 00:15:16 -05:00
parent 05c7d49a62
commit 07dc0ce988
4 changed files with 16 additions and 6 deletions

View File

@@ -268,6 +268,7 @@ RGBController_SteelSeriesApex::RGBController_SteelSeriesApex(SteelSeriesApexCont
name = "SteelSeries Apex RGB Keyboard";
type = DEVICE_TYPE_KEYBOARD;
description = "SteelSeries Apex RGB Device";
location = steelseries->GetDeviceLocation();
proto_type = steelseries->proto_type;

View File

@@ -31,10 +31,11 @@ static unsigned int keys_tkl[] = {0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b
0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52,
0x64, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xf0, 0x31 };
SteelSeriesApexController::SteelSeriesApexController(hid_device* dev_handle, steelseries_type type)
SteelSeriesApexController::SteelSeriesApexController(hid_device* dev_handle, steelseries_type type, const char* path)
{
dev = dev_handle;
proto_type = type;
dev = dev_handle;
location = path;
proto_type = type;
}
SteelSeriesApexController::~SteelSeriesApexController()
@@ -42,6 +43,11 @@ SteelSeriesApexController::~SteelSeriesApexController()
}
std::string SteelSeriesApexController::GetDeviceLocation()
{
return(location);
}
void SteelSeriesApexController::SetMode
(
unsigned char mode,

View File

@@ -23,9 +23,11 @@ enum
class SteelSeriesApexController
{
public:
SteelSeriesApexController(hid_device* dev_handle, steelseries_type type);
SteelSeriesApexController(hid_device* dev_handle, steelseries_type type, const char* path);
~SteelSeriesApexController();
std::string GetDeviceLocation();
steelseries_type proto_type;
void SetMode
@@ -39,9 +41,10 @@ public:
private:
hid_device* dev;
unsigned char active_mode;
std::string location;
void SelectProfile
(
unsigned char profile
);
};
};

View File

@@ -128,7 +128,7 @@ void DetectSteelSeriesControllers(std::vector<RGBController*>& rgb_controllers)
{
case DEVICE_TYPE_KEYBOARD:
{
SteelSeriesApexController* controller = new SteelSeriesApexController(dev, device_list[device_idx].proto_type);
SteelSeriesApexController* controller = new SteelSeriesApexController(dev, device_list[device_idx].proto_type, info->path);
RGBController_SteelSeriesApex* rgb_controller = new RGBController_SteelSeriesApex(controller);
rgb_controller->name = device_list[device_idx].name;