#include #include #include #include "classes/Keyboard.h" using namespace std; void usage() { string appname = "g810-led"; cout< var; vector keys; lg_kbd.attach(); while (!file.eof()) { getline(file, 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 == "-fx-color" && argc == 3) return setFXColor(argv[2]); else if (argCmd == "-fx-breathing" && argc == 4) return setFXBreathing(argv[2], argv[3]); else if (argCmd == "-fx-cycle" && argc == 3) return setFXColorCycle(argv[2]); else if (argCmd == "-fx-hwave" && argc == 3) return setFXHWave(argv[2]); else if (argCmd == "-fx-vwave" && argc == 3) return setFXVWave(argv[2]); else if (argCmd == "-fx-cwave" && argc == 3) return setFXCWave(argv[2]); } usage(); return 1; }