Add ability to ignore devices

This commit is contained in:
pixl
2020-07-14 16:21:14 -04:00
parent 497ec07bdf
commit 018bdb83ad
4 changed files with 66 additions and 0 deletions
+11
View File
@@ -32,6 +32,17 @@ void DeviceManager::addDevice(std::string path)
{
bool defaultExists = true;
bool isReceiver = false;
// Check if device is ignored before continuing
{
raw::RawDevice raw_dev(path);
if(global_config->isIgnored(raw_dev.productId())) {
logPrintf(DEBUG, "%s: Device 0x%04x ignored.",
path.c_str(), raw_dev.productId());
return;
}
}
try {
hidpp::Device device(path, hidpp::DefaultDevice);
isReceiver = device.version() == std::make_tuple(1, 0);