1
0
mirror of https://github.com/MatMoul/g810-led.git synced 2024-12-23 09:16:11 +00:00

Add G610 support

This commit is contained in:
MatMoul 2016-11-18 21:48:50 +01:00
parent 64b1a59849
commit b23e48069b
2 changed files with 2 additions and 1 deletions

View File

@ -2,7 +2,7 @@
Linux LED controller for the Logitech G810 Keyboard Linux LED controller for the Logitech G810 Keyboard
Compatible with the Logitech G410 Keyboard (look at the wiki : https://github.com/MatMoul/g810-led/wiki) Compatible with the Logitech G410 and G610 Keyboard (look at the wiki : https://github.com/MatMoul/g810-led/wiki)
![jj](https://raw.githubusercontent.com/MatMoul/g810-led/master/pictures/logitech_g810-2.jpg) ![jj](https://raw.githubusercontent.com/MatMoul/g810-led/master/pictures/logitech_g810-2.jpg)

View File

@ -394,6 +394,7 @@ bool Keyboard::parseKeyGroup(std::string key, KeyGroup &keyGroup) {
} }
bool Keyboard::parseColor(std::string color, KeyColors &colors) { bool Keyboard::parseColor(std::string color, KeyColors &colors) {
if (color.length() == 2) color = color + "0000"; // For G610
if (color.length() != 6) return false; if (color.length() != 6) return false;
colors.red = std::stoul("0x"+color.substr(0,2), nullptr, 16); colors.red = std::stoul("0x"+color.substr(0,2), nullptr, 16);
colors.green = std::stoul("0x"+color.substr(2,2), nullptr, 16); colors.green = std::stoul("0x"+color.substr(2,2), nullptr, 16);