diff --git a/src/classes/Keyboard.cpp b/src/classes/Keyboard.cpp index bb13e7c..2ecaceb 100644 --- a/src/classes/Keyboard.cpp +++ b/src/classes/Keyboard.cpp @@ -21,15 +21,6 @@ LedKeyboard::~LedKeyboard() { } -bool LedKeyboard::overrideKeyboard(uint16_t vendorID, uint16_t productID, KeyboardModel model) { - if(model==KeyboardModel::unknown) return false; - SupportedKeyboards = { - { vendorID, productID, (u_int16_t)model } - }; - return true; -} - - vector LedKeyboard::listKeyboards() { vector deviceList; diff --git a/src/classes/Keyboard.h b/src/classes/Keyboard.h index b98e969..86ac406 100644 --- a/src/classes/Keyboard.h +++ b/src/classes/Keyboard.h @@ -16,17 +16,6 @@ class LedKeyboard { private: - std::vector> SupportedKeyboards = { - { 0x46d, 0xc336, (u_int16_t)KeyboardModel::g213 }, - { 0x46d, 0xc330, (u_int16_t)KeyboardModel::g410 }, - { 0x46d, 0xc333, (u_int16_t)KeyboardModel::g610 }, - { 0x46d, 0xc338, (u_int16_t)KeyboardModel::g610 }, - { 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 } - }; - enum class KeyAddressGroup : uint8_t { logo = 0x00, indicators, @@ -38,6 +27,17 @@ class LedKeyboard { public: + std::vector> SupportedKeyboards = { + { 0x46d, 0xc336, (u_int16_t)KeyboardModel::g213 }, + { 0x46d, 0xc330, (u_int16_t)KeyboardModel::g410 }, + { 0x46d, 0xc333, (u_int16_t)KeyboardModel::g610 }, + { 0x46d, 0xc338, (u_int16_t)KeyboardModel::g610 }, + { 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 } + }; + enum class KeyboardModel : uint8_t { unknown = 0x00, g213, @@ -134,8 +134,6 @@ class LedKeyboard { ~LedKeyboard(); - bool overrideKeyboard(uint16_t vendorID, uint16_t productID, KeyboardModel model); - std::vector listKeyboards(); bool isOpen(); diff --git a/src/main.cpp b/src/main.cpp index 9451fcd..06c76db 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -283,13 +283,13 @@ int main(int argc, char **argv) { if (! utils::parseUInt8(argv[argIndex + 1], kbdProtocol)) return 1; switch(kbdProtocol) { case 1: - kbd.overrideKeyboard(vendorID, productID, LedKeyboard::KeyboardModel::g810); + kbd.SupportedKeyboards = { { vendorID, productID, (u_int16_t)LedKeyboard::KeyboardModel::g810 } }; break; case 2: - kbd.overrideKeyboard(vendorID, productID, LedKeyboard::KeyboardModel::g910); + kbd.SupportedKeyboards = { { vendorID, productID, (u_int16_t)LedKeyboard::KeyboardModel::g910 } }; break; case 3: - kbd.overrideKeyboard(vendorID, productID, LedKeyboard::KeyboardModel::g213); + kbd.SupportedKeyboards = { { vendorID, productID, (u_int16_t)LedKeyboard::KeyboardModel::g213 } }; break; default: break;