Store name in HyperXMouseControllers to avoid setting it in detectors

This commit is contained in:
Adam Honse 2025-08-10 21:17:20 -05:00
parent 0c0ffe7f5c
commit ca554d9ef6
16 changed files with 148 additions and 121 deletions

View file

@ -13,10 +13,11 @@
#include "HyperXPulsefireFPSProController.h"
#include "StringUtils.h"
HyperXPulsefireFPSProController::HyperXPulsefireFPSProController(hid_device* dev_handle, const char* path)
HyperXPulsefireFPSProController::HyperXPulsefireFPSProController(hid_device* dev_handle, const char* path, std::string dev_name)
{
dev = dev_handle;
location = path;
name = dev_name;
}
HyperXPulsefireFPSProController::~HyperXPulsefireFPSProController()
@ -29,6 +30,11 @@ std::string HyperXPulsefireFPSProController::GetDeviceLocation()
return("HID " + location);
}
std::string HyperXPulsefireFPSProController::GetNameString()
{
return(name);
}
std::string HyperXPulsefireFPSProController::GetSerialString()
{
wchar_t serial_string[128];

View file

@ -23,10 +23,11 @@ enum
class HyperXPulsefireFPSProController
{
public:
HyperXPulsefireFPSProController(hid_device* dev_handle, const char* path);
HyperXPulsefireFPSProController(hid_device* dev_handle, const char* path, std::string dev_name);
~HyperXPulsefireFPSProController();
std::string GetDeviceLocation();
std::string GetNameString();
std::string GetSerialString();
void SendDirect
@ -37,4 +38,5 @@ public:
private:
hid_device* dev;
std::string location;
std::string name;
};

View file

@ -26,20 +26,20 @@ using namespace std::chrono_literals;
RGBController_HyperXPulsefireFPSPro::RGBController_HyperXPulsefireFPSPro(HyperXPulsefireFPSProController* controller_ptr)
{
controller = controller_ptr;
controller = controller_ptr;
name = "HyperX Pulsefire FPS Pro Device";
vendor = "HyperX";
type = DEVICE_TYPE_MOUSE;
description = "HyperX Pulsefire FPS Pro Device";
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
name = controller->GetNameString();
vendor = "HyperX";
type = DEVICE_TYPE_MOUSE;
description = "HyperX Pulsefire FPS Pro Device";
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
Direct.value = 0xFFFF;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
Direct.name = "Direct";
Direct.value = 0xFFFF;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
SetupZones();