diff --git a/src/classes/Keyboard.cpp b/src/classes/Keyboard.cpp index 382f9cc..4ebfe9f 100644 --- a/src/classes/Keyboard.cpp +++ b/src/classes/Keyboard.cpp @@ -490,6 +490,26 @@ bool LedKeyboard::setMNKey(uint8_t value) { return false; } +bool LedKeyboard::setGKeysMode(uint8_t value) { + LedKeyboard::byte_buffer_t data; + switch (m_keyboardModel) { + case KeyboardModel::g910: + switch (value) { + case 0x00: + case 0x01: + data = { 0x11, 0xff, 0x08, 0x2e, value }; + data.resize(20, 0x00); + return sendDataInternal(data); + default: + break; + } + break; + default: + break; + } + return false; +} + bool LedKeyboard::setStartupMode(StartupMode startupMode) { byte_buffer_t data; diff --git a/src/classes/Keyboard.h b/src/classes/Keyboard.h index 3a0be18..946382f 100644 --- a/src/classes/Keyboard.h +++ b/src/classes/Keyboard.h @@ -142,6 +142,7 @@ class LedKeyboard { bool setMRKey(uint8_t value); bool setMNKey(uint8_t value); + bool setGKeysMode(uint8_t value); bool setStartupMode(StartupMode startupMode); diff --git a/src/helpers/help.cpp b/src/helpers/help.cpp index 1c3757f..7358700 100644 --- a/src/helpers/help.cpp +++ b/src/helpers/help.cpp @@ -22,6 +22,8 @@ namespace help { if (cmdName == "g910-led") { cout<<" -mr {value}\t\t\t\tSet MR key (0-1)"< 1) { if (setMNKey(kbd, args[1], false) == 1) retval = 1; + } else if (args[0] == "gkm" && args.size() > 1) { + if (setGKeysMode(kbd, args[1], false) == 1) retval = 1; } else if (args[0] == "fx" && args.size() > 4) { if (setFX(kbd, args[1], args[2], args[3], args[4]) == 1) retval = 1; } else if (args[0] == "fx" && args.size() > 3) { @@ -233,6 +244,8 @@ int main(int argc, char **argv) { else if (argc > 2 && arg == "-mrn") return setMRKey(kbd, argv[2], false); else if (argc > 2 && arg == "-mnn") return setMNKey(kbd, argv[2], false); + else if (argc > 2 && arg == "-gkm") return setGKeysMode(kbd, argv[2]); + else if (argc > 2 && arg == "-p") return loadProfile(kbd, argv[2]); else if (argc > 1 && arg == "-pp") return pipeProfile(kbd);