#include #include #include #include #include #include "classes/Keyboard.h" using namespace std; string appname = "g810-led"; void usage() { cout< var; vector keys; lg_kbd.attach(); while (!is.eof()) { getline(is, line); if (line.substr(0, 3) == "var") { line = line.substr(4); ind = line.find(" "); var[line.substr(0, ind)] = line.substr(ind + 1, 6); } else if (line.substr(0, 1) == "a") { line = line.substr(2); if (line.substr(0, 1) == "$") { ind = line.find(" "); line = var[line.substr(1, ind - 1)]; } else line = line.substr(0, 6); if (lg_kbd.parseColor(line, colors) == true) { keys.clear(); lg_kbd.setAllKeys(colors); } else cout<<"Error on line "< 1) { string argCmd = argv[1]; if (argCmd == "-h" || argCmd == "--help") { usage(); return 0; } else if (argCmd == "-lk" || argCmd == "--list-keys") { listkeys(); return 0; } else if (argCmd == "-s" && argc == 3) return setStartupEffect(argv[2]); else if (argCmd == "-a" && argc == 3) return setAllKeys(argv[2], true); else if (argCmd == "-an" && argc == 3) return setAllKeys(argv[2], false); else if (argCmd == "-g" && argc == 4) return setGroupKeys(argv[2], argv[3], true); else if (argCmd == "-gn" && argc == 4) return setGroupKeys(argv[2], argv[3], false); else if (argCmd == "-k" && argc == 4) return setKey(argv[2], argv[3], true); else if (argCmd == "-kn" && argc == 4) return setKey(argv[2], argv[3], false); else if (argCmd == "-c" && argc == 2) return commit(); else if (argCmd == "-p" && argc == 3) return loadProfile(argv[2]); else if (argCmd == "-pp" && argc == 2) return pipeProfile(); else if (argCmd == "-fx-color" && argc == 3) return setFXColor(argv[2], true, true); else if (argCmd == "-fx-breathing" && argc == 4) return setFXBreathing(argv[2], argv[3], true, true); else if (argCmd == "-fx-cycle" && argc == 3) return setFXColorCycle(argv[2], true, true); else if (argCmd == "-fx-hwave" && argc == 3) return setFXHWave(argv[2], true, true); else if (argCmd == "-fx-vwave" && argc == 3) return setFXVWave(argv[2], true, true); else if (argCmd == "-fx-cwave" && argc == 3) return setFXCWave(argv[2], true, true); else if (argCmd == "-fxk-color" && argc == 3) return setFXColor(argv[2], true, false); else if (argCmd == "-fxk-breathing" && argc == 4) return setFXBreathing(argv[2], argv[3], true, false); else if (argCmd == "-fxk-cycle" && argc == 3) return setFXColorCycle(argv[2], true, false); else if (argCmd == "-fxk-hwave" && argc == 3) return setFXHWave(argv[2], true, false); else if (argCmd == "-fxk-vwave" && argc == 3) return setFXVWave(argv[2], true, false); else if (argCmd == "-fxk-cwave" && argc == 3) return setFXCWave(argv[2], true, false); else if (argCmd == "-fxl-color" && argc == 3) return setFXColor(argv[2], false, true); else if (argCmd == "-fxl-breathing" && argc == 4) return setFXBreathing(argv[2], argv[3], false, true); else if (argCmd == "-fxl-cycle" && argc == 3) return setFXColorCycle(argv[2], false, true); } usage(); return 1; }