diff --git a/README.md b/README.md index b23021c..ba4bd4b 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,11 @@ This is an unofficial driver for Logitech mice and keyboard. This is currently only compatible with HID++ \>2.0 devices. +## Configuration +[Refer to the wiki for details.](https://github.com/PixlOne/logiops/wiki/Configuration) + +You may also refer to logid.example.cfg for an example. + ## Building This project requires a C++14 compiler, cmake, libevdev, libconfig, and [my fork of libhidpp](https://github.com/PixlOne/hidpp) diff --git a/src/logid/Device.cpp b/src/logid/Device.cpp index 82a9ac2..9c10c4f 100644 --- a/src/logid/Device.cpp +++ b/src/logid/Device.cpp @@ -42,6 +42,8 @@ Device::Device(std::string p, const HIDPP::DeviceIndex i) : path(std::move(p)), void Device::configure(bool scanning) { + // Divert buttons + divert_buttons(); // Set DPI if it is set if(config->dpi != nullptr) set_dpi(*config->dpi, scanning); @@ -51,8 +53,6 @@ void Device::configure(bool scanning) // Set Hires Scroll if it is set if(config->hiresscroll != nullptr) set_hiresscroll(*config->hiresscroll, scanning); - // Divert buttons - divert_buttons(); } void Device::divert_buttons(bool scanning) @@ -306,8 +306,12 @@ void Device::move_diverted(uint16_t cid, HIDPP20::IReprogControlsV4::Move m) std::map Device::get_features() { - std::map features; + std::map _features; HIDPP20::IFeatureSet ifs (hidpp_dev); unsigned int feature_count = ifs.getCount(); - return features; + + for(int i = 0; i < feature_count; i++) + _features.insert( {i, ifs.getFeatureID(i) } ); + + return _features; } \ No newline at end of file