Store name in AOCMouseController to avoid setting it in detector
This commit is contained in:
parent
5799ea8160
commit
74bbaaf643
4 changed files with 12 additions and 5 deletions
|
|
@ -13,10 +13,11 @@
|
|||
#include "AOCMouseController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
AOCMouseController::AOCMouseController(hid_device* dev_handle, const char* path)
|
||||
AOCMouseController::AOCMouseController(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
}
|
||||
|
||||
AOCMouseController::~AOCMouseController()
|
||||
|
|
@ -29,6 +30,11 @@ std::string AOCMouseController::GetDeviceLocation()
|
|||
return("HID " + location);
|
||||
}
|
||||
|
||||
std::string AOCMouseController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string AOCMouseController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
|
|
|
|||
|
|
@ -56,10 +56,11 @@ enum
|
|||
class AOCMouseController
|
||||
{
|
||||
public:
|
||||
AOCMouseController(hid_device* dev_handle, const char* path);
|
||||
AOCMouseController(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
~AOCMouseController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
std::string GetSerialString();
|
||||
|
||||
void SendDirect
|
||||
|
|
@ -79,4 +80,5 @@ public:
|
|||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -33,9 +33,8 @@ void DetectAOCMouseControllers(hid_device_info* info, const std::string& name)
|
|||
|
||||
if(dev)
|
||||
{
|
||||
AOCMouseController* controller = new AOCMouseController(dev, info->path);
|
||||
AOCMouseController* controller = new AOCMouseController(dev, info->path, name);
|
||||
RGBController_AOCMouse* rgb_controller = new RGBController_AOCMouse(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ RGBController_AOCMouse::RGBController_AOCMouse(AOCMouseController* controller_pt
|
|||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = "AOC Mouse Device";
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "AOC";
|
||||
type = DEVICE_TYPE_MOUSE;
|
||||
description = "AOC Mouse Device";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue