diff --git a/README.md b/README.md index 48d5162..187e7db 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # g810-led
-Linux led controller for Logitech G213, G410, G610, G810 and G910 Keyboards.
+Linux led controller for Logitech G213, G410, G610, G810, G910 and G PRO Keyboards.
## Compatible keyboards :
- **G213 Prodigy**
@@ -10,6 +10,7 @@ Linux led controller for Logitech G213, G410, G610, G810 and G910 Keyboards.
- **G910 Orion Spark**
- **G910 Orion Spectrum**
+- **G PRO**
## Contribute and evolution :
* [CONTRIBUTING.md](https://github.com/MatMoul/g810-led/blob/master/CONTRIBUTING.md) diff --git a/src/classes/Keyboard.cpp b/src/classes/Keyboard.cpp index 2ecaceb..c6ff8a5 100644 --- a/src/classes/Keyboard.cpp +++ b/src/classes/Keyboard.cpp @@ -359,6 +359,7 @@ bool LedKeyboard::commit() { case KeyboardModel::g410: case KeyboardModel::g610: case KeyboardModel::g810: + case KeyboardModel::gpro: data = { 0x11, 0xff, 0x0c, 0x5a }; break; case KeyboardModel::g910: @@ -394,6 +395,7 @@ bool LedKeyboard::setKeys(KeyValueArray keyValues) { switch (currentDevice.model) { case LedKeyboard::KeyboardModel::g610: case LedKeyboard::KeyboardModel::g810: + case LedKeyboard::KeyboardModel::gpro: if (SortedKeys[0].size() <= 1 && keyValues[i].key == LedKeyboard::Key::logo) SortedKeys[0].push_back(keyValues[i]); break; @@ -411,6 +413,7 @@ bool LedKeyboard::setKeys(KeyValueArray keyValues) { switch (currentDevice.model) { case LedKeyboard::KeyboardModel::g610: case LedKeyboard::KeyboardModel::g810: + case LedKeyboard::KeyboardModel::gpro: if (SortedKeys[2].size() <= 5) SortedKeys[2].push_back(keyValues[i]); break; default: @@ -431,6 +434,7 @@ bool LedKeyboard::setKeys(KeyValueArray keyValues) { case LedKeyboard::KeyboardModel::g610: case LedKeyboard::KeyboardModel::g810: case LedKeyboard::KeyboardModel::g910: + case LedKeyboard::KeyboardModel::gpro: if (SortedKeys[4].size() <= 120) SortedKeys[4].push_back(keyValues[i]); break; case LedKeyboard::KeyboardModel::g410: @@ -564,6 +568,7 @@ bool LedKeyboard::setAllKeys(LedKeyboard::Color color) { case KeyboardModel::g610: case KeyboardModel::g810: case KeyboardModel::g910: + case KeyboardModel::gpro: for (uint8_t i = 0; i < keyGroupLogo.size(); i++) keyValues.push_back({keyGroupLogo[i], color}); for (uint8_t i = 0; i < keyGroupIndicators.size(); i++) keyValues.push_back({keyGroupIndicators[i], color}); for (uint8_t i = 0; i < keyGroupMultimedia.size(); i++) keyValues.push_back({keyGroupMultimedia[i], color}); @@ -670,6 +675,7 @@ bool LedKeyboard::setStartupMode(StartupMode startupMode) { case KeyboardModel::g410: case KeyboardModel::g610: case KeyboardModel::g810: + case KeyboardModel::gpro: data = { 0x11, 0xff, 0x0d, 0x5a, 0x00, 0x01 }; break; case KeyboardModel::g910: @@ -695,6 +701,7 @@ bool LedKeyboard::setNativeEffect(NativeEffect effect, NativeEffectPart part, ui case KeyboardModel::g410: case KeyboardModel::g610: // Unconfirmed case KeyboardModel::g810: + case KeyboardModel::gpro: protocolByte = 0x0d; break; case KeyboardModel::g910: @@ -815,6 +822,7 @@ LedKeyboard::byte_buffer_t LedKeyboard::getKeyGroupAddress(LedKeyboard::KeyAddre case KeyboardModel::g410: case KeyboardModel::g610: case KeyboardModel::g810: + case KeyboardModel::gpro: switch (keyAddressGroup) { case LedKeyboard::KeyAddressGroup::logo: return { 0x11, 0xff, 0x0c, 0x3a, 0x00, 0x10, 0x00, 0x01 }; diff --git a/src/classes/Keyboard.h b/src/classes/Keyboard.h index 86ac406..9fd7bd3 100644 --- a/src/classes/Keyboard.h +++ b/src/classes/Keyboard.h @@ -35,7 +35,8 @@ class LedKeyboard { { 0x46d, 0xc331, (u_int16_t)KeyboardModel::g810 }, { 0x46d, 0xc337, (u_int16_t)KeyboardModel::g810 }, { 0x46d, 0xc32b, (u_int16_t)KeyboardModel::g910 }, - { 0x46d, 0xc335, (u_int16_t)KeyboardModel::g910 } + { 0x46d, 0xc335, (u_int16_t)KeyboardModel::g910 }, + { 0x46d, 0xc339, (u_int16_t)KeyboardModel::gpro } }; enum class KeyboardModel : uint8_t { @@ -44,7 +45,8 @@ class LedKeyboard { g410, g610, g810, - g910 + g910, + gpro }; enum class StartupMode : uint8_t { wave = 0x01, diff --git a/src/helpers/help.cpp b/src/helpers/help.cpp index 7de95c2..b7987af 100644 --- a/src/helpers/help.cpp +++ b/src/helpers/help.cpp @@ -18,6 +18,7 @@ namespace help { else if(cmdName == "g610-led") return KeyboardFeatures::g610; else if(cmdName == "g810-led") return KeyboardFeatures::g810; else if(cmdName == "g910-led") return KeyboardFeatures::g910; + else if(cmdName == "gpro-led") return KeyboardFeatures::gpro; return KeyboardFeatures::all; } diff --git a/src/helpers/help.h b/src/helpers/help.h index 9fc177c..b07dc9f 100644 --- a/src/helpers/help.h +++ b/src/helpers/help.h @@ -30,8 +30,8 @@ namespace help { g410 = rgb | commit | setall | setgroup | setkey | poweronfx, g610 = intensity | commit | logo1 | numpad | multimedia | setall | setgroup | setkey | setindicators | poweronfx, g810 = rgb | commit | logo1 | numpad | multimedia | setall | setgroup | setkey | setindicators | poweronfx, - g910 = rgb | commit | logo1 | logo2 | numpad | multimedia | gkeys | setall | setgroup | setkey | setindicators | poweronfx - + g910 = rgb | commit | logo1 | logo2 | numpad | multimedia | gkeys | setall | setgroup | setkey | setindicators | poweronfx, + gpro = rgb | commit | logo1 | multimedia | setall | setgroup | setkey | setindicators | poweronfx }; inline KeyboardFeatures operator|(KeyboardFeatures a, KeyboardFeatures b); diff --git a/udev/g810-led.rules b/udev/g810-led.rules index a4edd40..fa3c75a 100644 --- a/udev/g810-led.rules +++ b/udev/g810-led.rules @@ -6,3 +6,4 @@ ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c3 ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c337", MODE="666" RUN+="/usr/bin/g810-led -p /etc/g810-led/profile" ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c32b", MODE="666" RUN+="/usr/bin/g910-led -p /etc/g810-led/profile" ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c335", MODE="666" RUN+="/usr/bin/g910-led -p /etc/g810-led/profile" +ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c339", MODE="666" RUN+="/usr/bin/g810-led -p /etc/g810-led/profile"