Compare commits

..

7 Commits

Author SHA1 Message Date
44b57a1641 Fix thumbwheel interval bug. Add my config.
Uses this fix:
https://github.com/PixlOne/logiops/issues/231#issuecomment-899835762
2023-04-09 16:14:02 -06:00
pixl
dbe2b28a53
Add Logitech trademarks to README 2022-01-31 14:52:17 -05:00
pixl
ed3b0ee067
Merge pull request #293 from tekq/patch-1
Update Dependencies to also include openSUSE
2022-01-30 16:06:35 -05:00
tekq
8c88335838
Update Dependencies to also include openSUSE now! 2022-01-28 23:32:35 +02:00
pixl
8e87b73d7d
Merge pull request #284 from damageboy/master
Resolve majority of clang+libstdc++ warnings
2022-01-06 16:26:39 -05:00
damageboy
7424c4fe94 Resolve majority of clang+libstdc++ warnings 2022-01-05 13:01:00 +02:00
damageboy
aa4c895c1e add .editorconfig to ease contribution by external devs 2022-01-05 12:53:55 +02:00
12 changed files with 157 additions and 10 deletions

25
.editorconfig Normal file
View File

@ -0,0 +1,25 @@
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*.{h,cpp}]
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true
# Matches multiple files with brace expansion notation
# Set default charset
[*.json]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true
# 4 space indentation
[CMakeLists.txt]
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true

View File

@ -25,6 +25,8 @@ This project requires a C++14 compiler, `cmake`, `libevdev`, `libudev`, and `lib
**Solus:** `sudo eopkg install libevdev-devel libconfig-devel libgudev-devel`
**openSUSE:** `sudo zypper install cmake libevdev-devel systemd-devel libconfig-devel gcc-c++ libconfig++-devel libudev-devel`
## Building
To build this project, run:
@ -49,7 +51,10 @@ I'm also looking for contributors to help in my project; feel free to submit a p
[For a list of tested devices, check TESTED.md](TESTED.md)
## Special Thanks
## Credits
Logitech, Logi, and their logos are trademarks or registered trademarks of Logitech Europe S.A. and/or its affiliates in the United States and/or other countries. This software is an independent product that is not endorsed or created by Logitech.
Thanks to the following people for contributing to this repository.
- [Clément Vuchener & contributors for creating the old HID++ library](https://github.com/cvuchener/hidpp)

111
logid.cfg Normal file
View File

@ -0,0 +1,111 @@
devices: (
{
name: "MX Master 3S";
smartshift:
{
on: true;
threshold: 30;
};
hiresscroll:
{
hires: false;
invert: false;
target: false;
};
dpi: 1000;
thumbwheel:
{
divert: true;
invert: false;
left:
{
threshold: 1;
interval: 10;
direction: "Left";
mode: "OnInterval";
action =
{
type: "Keypress";
keys: ["KEY_VOLUMEDOWN"];
};
};
right:
{
threshold: 1;
interval: 10;
direction: "Right";
mode: "OnInterval";
action =
{
type: "Keypress";
keys: ["KEY_VOLUMEUP"];
};
};
};
buttons: (
{
cid: 0xc3;
action =
{
type: "Gestures";
gestures: (
{
direction: "Up";
threshold: 50;
mode: "OnRelease";
action =
{
type: "Keypress";
keys: ["KEY_UP"];
};
},
{
direction: "Down";
threshold: 50;
mode: "OnRelease";
action =
{
type: "Keypress";
keys: ["KEY_DOWN"];
};
},
{
direction: "Left";
threshold: 50;
mode: "OnRelease";
action =
{
type: "Keypress";
keys: ["KEY_RIGHTMETA", "KEY_PAGEUP"];
};
},
{
direction: "Right";
threshold: 50;
mode: "OnRelease";
action =
{
type: "Keypress";
keys: ["KEY_RIGHTMETA", "KEY_PAGEDOWN"];
}
},
{
direction: "None"
mode: "NoPress"
}
);
};
},
{
cid: 0xc4;
action =
{
type: "Keypress";
keys: ["KEY_A"];
};
}
);
}
);

View File

@ -63,6 +63,8 @@ namespace actions {
virtual uint8_t reprogFlags() const = 0;
virtual ~Action() = default;
class Config
{
protected:

View File

@ -31,7 +31,7 @@ namespace actions
explicit InvalidGesture(std::string what="") : _what (what)
{
}
virtual const char* what()
virtual const char* what() const noexcept
{
return _what.c_str();
}
@ -49,6 +49,8 @@ namespace actions
virtual bool wheelCompatibility() const = 0;
virtual bool metThreshold() const = 0;
virtual ~Gesture() = default;
class Config
{
public:

View File

@ -49,7 +49,7 @@ namespace dj
Reason _reason;
};
class Receiver
class Receiver final
{
public:
explicit Receiver(std::string path);

View File

@ -33,7 +33,7 @@ namespace dj
{
public:
explicit ReceiverMonitor(std::string path);
~ReceiverMonitor();
virtual ~ReceiverMonitor();
void enumerate();
void run();

View File

@ -41,6 +41,7 @@ namespace hidpp20 {
static const uint16_t ID;
virtual uint16_t getID() = 0;
uint8_t featureIndex();
virtual ~Feature() = default;
protected:
explicit Feature(Device* dev, uint16_t _id);
std::vector<uint8_t> callFunction(uint8_t function_id,

View File

@ -122,7 +122,7 @@ namespace hidpp20
{
public:
static const uint16_t ID = FeatureID::REPROG_CONTROLS_V2;
virtual uint16_t getID() { return ID; }
virtual uint16_t getID() override { return ID; }
explicit ReprogControlsV2(Device* dev);
protected:
@ -133,7 +133,7 @@ namespace hidpp20
{
public:
static const uint16_t ID = FeatureID::REPROG_CONTROLS_V2_2;
virtual uint16_t getID() { return ID; }
virtual uint16_t getID() override { return ID; }
explicit ReprogControlsV2_2(Device* dev);
protected:
@ -144,7 +144,7 @@ namespace hidpp20
{
public:
static const uint16_t ID = FeatureID::REPROG_CONTROLS_V3;
virtual uint16_t getID() { return ID; }
virtual uint16_t getID() override { return ID; }
explicit ReprogControlsV3(Device* dev);
protected:
@ -155,7 +155,7 @@ namespace hidpp20
{
public:
static const uint16_t ID = FeatureID::REPROG_CONTROLS_V4;
virtual uint16_t getID() { return ID; }
virtual uint16_t getID() override { return ID; }
bool supportsRawXY() override { return true; }

View File

@ -40,7 +40,7 @@ namespace raw
void stop();
protected:
DeviceMonitor();
~DeviceMonitor();
virtual ~DeviceMonitor();
virtual void addDevice(std::string device) = 0;
virtual void removeDevice(std::string device) = 0;
private:

View File

@ -43,6 +43,7 @@ namespace features
}
virtual void configure() = 0;
virtual void listen() = 0;
virtual ~DeviceFeature() = default;
class Config
{
public:

View File

@ -149,7 +149,7 @@ void ThumbWheel::_handleEvent(hidpp20::ThumbWheel::ThumbwheelEvent event)
scroll_action = _config.leftAction();
if(scroll_action) {
scroll_action->press(true);
//scroll_action->press(true);
scroll_action->move(direction * event.rotation);
}