mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-04-09 00:17:38 -04:00
Store name in DasKeyboardController to avoid setting it in detector
This commit is contained in:
@@ -15,10 +15,11 @@
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
DasKeyboardController::DasKeyboardController(hid_device *dev_handle, const char *path)
|
||||
DasKeyboardController::DasKeyboardController(hid_device *dev_handle, const char *path, std::string dev_name)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
version = "";
|
||||
useTraditionalSendData = false;
|
||||
|
||||
@@ -30,11 +31,36 @@ DasKeyboardController::~DasKeyboardController()
|
||||
hid_close(dev);
|
||||
}
|
||||
|
||||
std::string DasKeyboardController::GetDeviceLocation()
|
||||
std::string DasKeyboardController::GetLayoutString()
|
||||
{
|
||||
/*-----------------------------------------------------------*\
|
||||
| Experimental for now; should be '16 or 63' for US and '28' |
|
||||
| for EU layout |
|
||||
\*-----------------------------------------------------------*/
|
||||
if(version.length() < 17)
|
||||
{
|
||||
return("NONE");
|
||||
}
|
||||
std::string layout_id = version.substr(3, 2);
|
||||
|
||||
if(layout_id == "16" || layout_id == "63")
|
||||
{
|
||||
return("US");
|
||||
}
|
||||
|
||||
return("EU");
|
||||
}
|
||||
|
||||
std::string DasKeyboardController::GetLocationString()
|
||||
{
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string DasKeyboardController::GetNameString()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string DasKeyboardController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
@@ -64,26 +90,6 @@ std::string DasKeyboardController::GetVersionString()
|
||||
return(fw_version);
|
||||
}
|
||||
|
||||
std::string DasKeyboardController::GetLayoutString()
|
||||
{
|
||||
/*-----------------------------------------------------------*\
|
||||
| Experimental for now; should be '16 or 63' for US and '28' |
|
||||
| for EU layout |
|
||||
\*-----------------------------------------------------------*/
|
||||
if(version.length() < 17)
|
||||
{
|
||||
return("NONE");
|
||||
}
|
||||
std::string layout_id = version.substr(3, 2);
|
||||
|
||||
if(layout_id == "16" || layout_id == "63")
|
||||
{
|
||||
return("US");
|
||||
}
|
||||
|
||||
return("EU");
|
||||
}
|
||||
|
||||
void DasKeyboardController::SendColors(unsigned char key_id, unsigned char mode,
|
||||
unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user