From 4dff14479857e2bce71d390e9c6c0bc1bd2fe5c8 Mon Sep 17 00:00:00 2001 From: PixlOne <8843371+PixlOne@users.noreply.github.com> Date: Wed, 11 Sep 2019 20:41:44 -0400 Subject: [PATCH] I forget what I did here. --- src/logid/Device.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/logid/Device.cpp b/src/logid/Device.cpp index 77310f8..d4b1c3e 100644 --- a/src/logid/Device.cpp +++ b/src/logid/Device.cpp @@ -31,6 +31,7 @@ Device::Device(std::string p, const HIDPP::DeviceIndex i) : path(std::move(p)), hidpp_dev = new HIDPP20::Device(dispatcher, index); name = hidpp_dev->name(); features = get_features(); + listener = new SimpleListener(new HIDPP::SimpleDispatcher(path.c_str()), index); // Set config, if none is found for this device then use default if(global_config->devices.find(name) == global_config->devices.end()) @@ -192,10 +193,9 @@ void Device::set_dpi(int dpi) void Device::start() { configure(); - auto *d = new HIDPP::SimpleDispatcher(path.c_str()); - listener = new SimpleListener(d, index); listener->addEventHandler( std::make_unique(hidpp_dev, this) ); - listener->addEventHandler( std::make_unique(this) ); + if(index != HIDPP::DefaultDevice && index != HIDPP::CordedDevice) + listener->addEventHandler( std::make_unique(this) ); listener->start(); }