Store name in AOCMousematController to avoid setting it in detector

This commit is contained in:
Adam Honse committed 2025-08-03 21:42:40 -05:00
1 parent 74bbaaf643
commit b9a8a62e38
4 files changed
+12 -5

No files matched your search

@@ -13,10 +13,11 @@
#include "AOCMousematController.h"
#include "StringUtils.h"
AOCMousematController::AOCMousematController(hid_device* dev_handle, const char* path)
AOCMousematController::AOCMousematController(hid_device* dev_handle, const char* path, std::string dev_name)
{
dev = dev_handle;
location = path;
name = dev_name;
}
AOCMousematController::~AOCMousematController()
@@ -29,6 +30,11 @@ std::string AOCMousematController::GetDeviceLocation()
return("HID " + location);
}
std::string AOCMousematController::GetDeviceName()
{
return(name);
}
std::string AOCMousematController::GetSerialString()
{
wchar_t serial_string[128];
@@ -55,10 +55,11 @@ enum
class AOCMousematController
{
public:
AOCMousematController(hid_device* dev_handle, const char* path);
AOCMousematController(hid_device* dev_handle, const char* path, std::string dev_name);
~AOCMousematController();
std::string GetDeviceLocation();
std::string GetDeviceName();
std::string GetSerialString();
void SendDirect
@@ -78,4 +79,5 @@ public:
private:
hid_device* dev;
std::string location;
std::string name;
};
@@ -33,9 +33,8 @@ void DetectAOCMousematControllers(hid_device_info* info, const std::string& name
if(dev)
{
AOCMousematController* controller = new AOCMousematController(dev, info->path);
AOCMousematController* controller = new AOCMousematController(dev, info->path, name);
RGBController_AOCMousemat* rgb_controller = new RGBController_AOCMousemat(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
@@ -26,7 +26,7 @@ RGBController_AOCMousemat::RGBController_AOCMousemat(AOCMousematController* cont
{
controller = controller_ptr;
name = "AOC Mousemat Device";
name = controller->GetDeviceName();
vendor = "AOC";
type = DEVICE_TYPE_MOUSEMAT;
description = "AOC Mousemat Device";