From 664f1346c7580af5e9699dc3eb75d6d539791c56 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 11 Mar 2017 18:53:29 +0100 Subject: [PATCH] Filter numpad keys for g410 --- TODO.md | 1 - src/classes/Keyboard.cpp | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/TODO.md b/TODO.md index e3dac5a..7135b06 100644 --- a/TODO.md +++ b/TODO.md @@ -12,7 +12,6 @@ ## Tasks (Assigned to MatMoul but you can participate) : * (80%) Add MKeys led control support -* (70%) Avoid sending keys that not supported by a keyboard model ## Possible enhancements : * Add deamon mode for custom effects diff --git a/src/classes/Keyboard.cpp b/src/classes/Keyboard.cpp index 6eb2808..382f9cc 100644 --- a/src/classes/Keyboard.cpp +++ b/src/classes/Keyboard.cpp @@ -310,11 +310,9 @@ bool LedKeyboard::setKeys(KeyValueArray keyValues) { if (SortedKeys[4].size() <= 120) SortedKeys[4].push_back(keyValues[i]); break; case LedKeyboard::KeyboardModel::g410: - // need filter num pad for G410 - // if (SortedKeys[4].size() <= 120 && keyValues[i].key > 0x07 && - // keyValues[i].key < 0x23) - // SortedKeys[4].push_back(keyValues[i]); - if (SortedKeys[4].size() <= 120) SortedKeys[4].push_back(keyValues[i]); + if (SortedKeys[4].size() <= 120) + if (keyValues[i].key < LedKeyboard::Key::num_lock || keyValues[i].key > LedKeyboard::Key::num_dot) + SortedKeys[4].push_back(keyValues[i]); break; default: break;